From 6a96d0996ed310416a18702b8378620e1591b685 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sat, 2 Mar 2024 02:44:07 +0000 Subject: [PATCH] New release flow --- .github/workflows/ci.yml | 21 ++++++--------------- README.md | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83b72f8..6771314 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,9 @@ on: push: branches: - main - tags: - - "*" pull_request: - branches: - - main + release: + published: env: REGISTRY: ghcr.io/ @@ -44,13 +42,12 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}${{ env.ISPG_IMAGE }} - # Before tests pass, we tag the image by 'tip' to indicate latest build, - # and by pull request number, e.g. pr-11 + # Before tests pass, we tag the image by the branch name + # or by pull request number, e.g. pr-11 # https://github.com/docker/metadata-action#tags-input # See the release workflow for the release tags. - # TODO: Figure out a better solution rather than using 'tip' tag tags: | - type=raw,value=tip # Must be here so we have at least one tag + type=ref,event=branch type=ref,event=pr - name: Build image @@ -92,7 +89,7 @@ jobs: release: if: >- - github.repository == 'ispg-group/aiidalab-ispg-docker-stack' + github.repository_owner == 'ispg-group' && (github.ref_type == 'tag' || github.ref_name == 'main') needs: - build @@ -127,9 +124,3 @@ jobs: with: src: ${{ env.REGISTRY }}${{ env.ISPG_IMAGE }}@${{ needs.build.outputs.image_digest }} dst: ${{ steps.meta.outputs.tags }} - - - uses: softprops/action-gh-release@v0.1.15 - name: Create release - if: startsWith(github.ref, 'refs/tags/v') - with: - generate_release_notes: true diff --git a/README.md b/README.md index 701e8c9..09501e7 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,25 @@ The following extra things are added on top of the `docker.io/aiidalab/full-stac Original image is generated and published on DockerHub at +## (dev) Releasing a new image + +We use bumpver to handle the release automation: + +```console +pipx install bumpver +git switch main && git pull origin main +# Check the changes first with a dry run +bumpver update --dry +bumpver update +``` + +This will create a release commit, tag it, and push it. +Once you see the build and tests pass, create a release for the new tag in GitHub UI at + +https://github.com/ispg-group/aiidalab-ispg-docker-stack/releases/new + +This will trigger a new workflow that should do a new build and push the new `latest` image. + ## Creating your own SSL certificates for HTTPS To get a proper certificate from a trusted Certificate Authority (CA),