Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
dotCMS/core#19969 new github workflow for publish github release (#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilvam authored Apr 15, 2021
1 parent b9ba34f commit 10672c7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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_RSA_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}}

0 comments on commit 10672c7

Please sign in to comment.