Skip to content

Commit

Permalink
Merge pull request #308 from sanger/unify-release-tag-image-names
Browse files Browse the repository at this point in the history
Unify release tag image names
  • Loading branch information
sdjmchattie authored Nov 9, 2022
2 parents ca1f71c + 6ff002a commit 2e777b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .flaskenv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FLASK_APP=baracoda

# https://flask.palletsprojects.com/en/2.2.x/cli/#setting-command-options
FLASK_RUN_HOST=0.0.0.0
FLASK_RUN_PORT=8000
FLASK_RUN_PORT=7900

# https://flask.palletsprojects.com/en/2.2.x/config/#DEBUG
FLASK_DEBUG=true
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/automated_release_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ jobs:
docker.pkg.github.com/${IMAGE_NAME}:${BRANCH_NAME}
python -m pytest --no-cov -vx
- name: Set release tag
- name: Set release name
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# On the develop branch this might create RELEASE_VERSION=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_VERSION=2.4.6
run: echo "RELEASE_VERSION=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV
# On the develop branch this might create RELEASE_NAME=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_NAME=2.4.6
run: echo "RELEASE_NAME=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV

- name: Set release tag
run: echo "RELEASE_TAG=v$RELEASE_NAME" >> $GITHUB_ENV

- name: Create release
uses: ncipollo/[email protected]
with:
name: ${{ env.RELEASE_VERSION }}
tag: v${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_NAME }}
tag: ${{ env.RELEASE_TAG }}
prerelease: ${{ !(github.ref == 'refs/heads/master') }}
commit: ${{ github.sha }}

Expand All @@ -71,11 +74,11 @@ jobs:
run: >-
docker tag
docker.pkg.github.com/${IMAGE_NAME}:${BRANCH_NAME}
docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_VERSION }}
docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_TAG }}
- name: Push release tag image to registry
run: >-
docker push docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_VERSION }}
docker push docker.pkg.github.com/${IMAGE_NAME}:${{ env.RELEASE_TAG }}
- name: Remove the oldest package
if: false
Expand Down

0 comments on commit 2e777b7

Please sign in to comment.