feat: latest builds (#150)

This commit is contained in:
Adam Uhlíř 2022-06-06 14:10:26 +02:00 committed by GitHub
parent 2836ffffd2
commit 2ef924d615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -97,14 +97,14 @@ jobs:
- name: Update bee version in package.json
uses: jossef/action-set-json-field@v1
if: ${{ github.event_name == 'repository_dispatch' }}
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag != 'latest' }}
with:
file: package.json
field: engines.bee
value: ${{ env.BEE_VERSION }}
- name: Create/update PR
if: ${{ github.event_name == 'repository_dispatch' }}
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag != 'latest' }}
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_GHA_PAT }}
@ -116,7 +116,7 @@ jobs:
author: "bee-worker <bee-worker@ethswarm.org>"
- name: Trigger Bee-js PR creation
if: ${{ github.event_name == 'repository_dispatch' }}
if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag != 'latest' }}
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_GHA_PAT }}

View File

@ -66,6 +66,12 @@ upon every new Bee release, so you can just specify which version you want to ru
If for some reason you want built your own images, that is possible but discouraged and not supported (**here be dragons**) using the scripts in the `generator` subfolder.
Upon building and publishing these images you can consume them using with Bee Factory with the `--repo` flag.
#### Latest versions
There is special Bee Factory image tag `latest` that has the latest Bee's master build.
It is not recommended using this tag unless you need to test some upcoming feature and know what are you doing.
There is high chance that there might be some change in Bee that is not compatible with current Bee Factory and so it might not even work.
## Contribute
There are some ways you can make this module better:

View File

@ -6,6 +6,10 @@ const readFile = promisify(readFileCb)
const VERSION_REGEX = /^\d\.\d\.\d(-\w+)*$/
export function stripCommit(version: string): string {
if (version === 'latest') {
return version
}
if (!VERSION_REGEX.test(version)) {
throw new Error('The version does not have expected format!')
}