v0.4.0 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish release | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Semantic version tag of the release (vX.Y.Z)." | |
required: true | |
latest: | |
description: "Whether to update the latest tag." | |
type: boolean | |
default: false | |
jobs: | |
complete-release-branch-transaction: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
env: | |
FULL_VERSION: ${{ github.event.release.tag_name }}${{ github.event.inputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 # fetch all history | |
token: ${{ secrets.NUNKI_CI_COMMIT_PUSH_PR }} | |
- name: Determine branch names | |
run: | | |
RELEASE_BRANCH="release/${FULL_VERSION%.*}" | |
WORKING_BRANCH="tmp/${FULL_VERSION}" | |
{ | |
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" | |
echo "WORKING_BRANCH=${WORKING_BRANCH}" | |
} | tee -a "$GITHUB_ENV" | |
- name: Create or update release branch | |
run: | | |
git fetch | |
git checkout "${WORKING_BRANCH}" # ensure branch exists locally | |
git push origin "${WORKING_BRANCH}":"${RELEASE_BRANCH}" | |
- name: Remove temporary branch | |
run: | | |
git push origin --delete "${WORKING_BRANCH}" |