forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.73 KB
/
prepare-patch-release-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Prepare AliPhysics tag
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to prepare'
required: true
default: 'v5-09-XXy'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Decide which branch to use
run: |
cat << EOF
::set-output name=branch::$(echo AliPhysics-${{ github.event.inputs.tag }}-01-patches | sed -e's/[a-z][a-z]*-01-patches$/-01-patches/')
EOF
id: decide_release_branch
- uses: actions/checkout@v2
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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: AliPhysics-${{ github.event.inputs.tag }}-01
release_name: AliPhysics-${{ github.event.inputs.tag }}-01
draft: false
prerelease: false