diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fe9e552..35cae4f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,6 +7,11 @@ on: description: 'Semantic version to label the Docker image under' required: true type: string + tag_latest: + description: 'Also tag this image as :latest? (Keep false for RC and beta releases)' + required: false + type: boolean + default: false jobs: check_authorization: @@ -41,4 +46,4 @@ jobs: push: true tags: | ghcr.io/crosstalk-solutions/project-nomad:${{ inputs.version }} - ghcr.io/crosstalk-solutions/project-nomad:latest + ${{ inputs.tag_latest && 'ghcr.io/crosstalk-solutions/project-nomad:latest' || '' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64c4a4f..bd20bc7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,10 @@ jobs: GIT_COMMITTER_EMAIL: dev@cosmistack.com - name: Finalize release notes - if: steps.semver.outputs.new_release_published == 'true' + # Skip for pre-releases (versions containing a hyphen, e.g. 1.27.0-rc.1) + if: | + steps.semver.outputs.new_release_published == 'true' && + !contains(steps.semver.outputs.new_release_version, '-') id: finalize-notes env: GITHUB_REPOSITORY: ${{ github.repository }} @@ -55,17 +58,23 @@ jobs: fi - name: Commit finalized release notes - if: steps.semver.outputs.new_release_published == 'true' && steps.finalize-notes.outputs.has_notes == 'true' + if: | + steps.semver.outputs.new_release_published == 'true' && + steps.finalize-notes.outputs.has_notes == 'true' && + !contains(steps.semver.outputs.new_release_version, '-') run: | git config user.name "cosmistack-bot" git config user.email "dev@cosmistack.com" git remote set-url origin https://x-access-token:${{ secrets.COSMISTACKBOT_ACCESS_TOKEN }}@github.com/${{ github.repository }}.git git add admin/docs/release-notes.md git commit -m "docs(release): finalize v${{ steps.semver.outputs.new_release_version }} release notes [skip ci]" - git push origin master + git push origin ${{ github.ref_name }} - name: Update GitHub release body - if: steps.semver.outputs.new_release_published == 'true' && steps.finalize-notes.outputs.has_notes == 'true' + if: | + steps.semver.outputs.new_release_published == 'true' && + steps.finalize-notes.outputs.has_notes == 'true' && + !contains(steps.semver.outputs.new_release_version, '-') env: GH_TOKEN: ${{ secrets.COSMISTACKBOT_ACCESS_TOKEN }} run: | diff --git a/.releaserc.json b/.releaserc.json index e06f66a..19253ac 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,5 +1,8 @@ { - "branches": ["master"], + "branches": [ + "master", + { "name": "rc", "prerelease": "rc" } + ], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator",