-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (38 loc) · 1.32 KB
/
publish-github-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
name: Publish GitHub Release
on:
push:
branches:
- release-*
jobs:
publish-release:
name: Publish GitHub Release
runs-on: ubuntu-18.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSH_KEY: ${{ secrets.DOTCMS_BUILD_RSA_KEY }}
DEBUG: false
steps:
- name: Get commit message
id: get-commit-message
uses: dotcms/get-commit-message@master
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare
if: ${{ steps.get-commit-message.outputs.commit_message == 'Publish Release'}}
run: |
COMMIT_MESSG="${{ steps.get-commit-message.outputs.commit_message }}"
echo "COMMIT_MESSG: ${COMMIT_MESSG}"
BRANCH=$(basename "${{ github.ref }}")
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
IFS='-' read -r -a tokens <<< "${BRANCH}"
RELEASE_VERSION="${tokens[1]}"
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
- name: Create Release
id: create_release
if: ${{ steps.get-commit-message.outputs.commit_message == 'Publish Release'}}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{env.RELEASE_VERSION}} Release
commit: ${{env.BRANCH}}
tag: v${{env.RELEASE_VERSION}}