v3.19.0 #111
Workflow file for this run
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: create-gh-release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
workflow_dispatch: | |
inputs: | |
tag_ref: | |
description: "refs/tags/v2.6.2" | |
required: true | |
type: string | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# With fetch-depth 0 the checkout action will also fetch all tags and branches. We need the tags for | |
# ./disallow-major-release.sh to work. | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT }} | |
- name: Set GITHUB_REF from input | |
if: "${{ inputs.tag_ref != '' }}" | |
run: | | |
echo "GITHUB_REF=${{ inputs.tag_ref }}" >> $GITHUB_ENV | |
- name: Set GITHUB_REF from original | |
if: "${{ inputs.tag_ref == '' }}" | |
run: | | |
echo "GITHUB_REF=$GITHUB_REF" >> $GITHUB_ENV | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
changelog: CHANGELOG.md | |
draft: true | |
ref: ${{ env.GITHUB_REF }} | |
token: ${{ secrets.GH_PAT }} | |
- name: Send success message | |
if: "${{ success() }}" | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"text": "Github release has been created successfully! :tada:", | |
"attachments": [{ | |
"color": "good", | |
"fields": [ | |
{ | |
"title": "Releases URL", | |
"value": "<${{ github.server_url }}/${{ github.repository }}/releases>" | |
} | |
] | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEAM_NODE_CHANNEL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
- name: Send failure message | |
if: "${{ failure() }}" | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ | |
"text": ":boom: :scream: Github Release has failed! :scream_cat: :sob:", | |
"attachments": [{ | |
"color": "danger" | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEAM_NODE_CHANNEL }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |