Prepare AliRoot/AliPhysics tag #93
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: Prepare AliPhysics tag | |
'on': | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to prepare' | |
required: true | |
default: 'v5-09-XXy' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide which branch to use | |
run: | | |
sed -r 's/[a-z]+-01-patches$/-01-patches/' <<\EOF >> "$GITHUB_OUTPUT" | |
branch=AliPhysics-${{ github.event.inputs.tag }}-01-patches | |
EOF | |
id: decide_release_branch | |
- uses: actions/checkout@v3 | |
with: | |
ref: "master" | |
- name: Update the branch | |
run: | | |
set -x | |
git fetch origin | |
git checkout -B ${{ steps.decide_release_branch.outputs.branch }} origin/${{ steps.decide_release_branch.outputs.branch }} | |
git grep -l v5-09 | xargs perl -p -i -e 's/v5-09-[0-9][0-9][a-z]*/${{ github.event.inputs.tag }}/g' | |
git add . | |
git diff | |
git config --global user.email "[email protected]" | |
git config --global user.name "ALICE Action Bot" | |
git commit -m "Bump to ${{ github.event.inputs.tag }}" -a || echo "No changes to commit" | |
git push --set-upstream origin ${{ steps.decide_release_branch.outputs.branch }} | |
git tag AliPhysics-${{ github.event.inputs.tag }}-01 | |
git push --set-upstream origin AliPhysics-${{ github.event.inputs.tag }}-01 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
# Use default token; requires "contents: write" permission. | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: AliPhysics-${{ github.event.inputs.tag }}-01 | |
release_name: AliPhysics-${{ github.event.inputs.tag }}-01 | |
draft: false | |
prerelease: false |