-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.74 KB
/
publish_release.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
name: Publish release
run-name: Publish new release with changes from commit '${{ github.event.head_commit.message }}' (${{ github.sha }})
on:
push:
branches:
# - 'main' # TODO: Uncomment
- 'test/IOS-6122_build_scripts' # TODO: remove since the default branch ('main') should be used as a target
jobs:
create_tag_and_release:
name: Create tag and release
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}_create_tag_and_release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract tag name from the commit message
id: extract_tag_name
env:
LATEST_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
# Extract the very last part of the commit message (in parentheses)
RELEASE_TAG_NAME=$(echo $LATEST_COMMIT_MESSAGE | awk -F'[()]' '{print $(NF-1)}' | sed 's/[()]//g');
# Check if the string is empty
if [ -z "${RELEASE_TAG_NAME}" ]; then
echo "Can't extract release tag name from the commit message '${LATEST_COMMIT_MESSAGE}'"
exit 1
fi
# Pass extracted tag name back to the GH actions pipeline
echo "release_tag_name=${RELEASE_TAG_NAME}" >> $GITHUB_OUTPUT
- name: Create tag and release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
tag_name: ${{ steps.extract_tag_name.outputs.release_tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
make_latest: true
target_commitish: 'test/IOS-6122_build_scripts' # TODO: remove since the default branch ('main') should be used as a target