From f7c9e798baea227e708c53fd044ce81d6b2eb427 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Wed, 29 Nov 2023 12:02:20 +0100 Subject: [PATCH] Update tagging workflow to handle v5-09-59 series --- .github/workflows/main.yml | 55 ++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab2f10f04cf..21059b30d9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,42 +1,39 @@ +--- name: Prepare AliRoot tag -on: +'on': workflow_dispatch: inputs: tag: description: 'Tag to prepare' required: true default: 'v5-09-XXy' + +permissions: + contents: write # to push a tag and create a release + jobs: build: runs-on: ubuntu-latest steps: - - name: Decide which branch to use - run: | - cat << EOF >> "$GITHUB_OUTPUT" - branch=$(echo ${{ github.event.inputs.tag }}-patches | sed -e's/[a-z][a-z]*-patches$/-patches/') - EOF - id: decide_release_branch - - uses: actions/checkout@v3 - with: - ref: "master" - - name: Tag branch (or create one before tagging if does not exists) - run: | - set -x - git fetch origin - git checkout -B ${{ steps.decide_release_branch.outputs.branch }} origin/${{ steps.decide_release_branch.outputs.branch }} - git config --global user.email "alibuild@cern.ch" - git config --global user.name "ALICE Action Bot" - git tag ${{ github.event.inputs.tag }} - git push --set-upstream origin ${{ github.event.inputs.tag }} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.event.inputs.tag }} - release_name: ${{ github.event.inputs.tag }} - draft: false - prerelease: false + - name: Decide which branch to use + run: | + case "$TAG" in + v5-09-59*) echo branch=master ;; + *) echo "branch=$(echo "$TAG-patches" | sed -r 's/[a-z]+-patches$/-patches/')" ;; + esac >> "$GITHUB_OUTPUT" + id: decide_release_branch + env: + TAG: ${{ github.event.inputs.tag }} + + - name: Tag and create release + uses: ncipollo/release-action@v1 + with: + name: ${{ github.event.inputs.tag }} + # The tag is created from the given commit if it does not exist yet. + tag: ${{ github.event.inputs.tag }} + commit: ${{ steps.decide_release_branch.outputs.branch }} + draft: false + prerelease: false + generateReleaseNotes: true