v2.30.1 #61
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: | |
channel-id: ${{ secrets.SLACK_CHANNEL_ID_TEAM }} | |
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_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Send failure message | |
if: "${{ failure() }}" | |
uses: slackapi/[email protected] | |
with: | |
channel-id: ${{ secrets.SLACK_CHANNEL_ID_TEAM }} | |
payload: | | |
{ | |
"text": ":boom: :scream: Github Release has failed! :scream_cat: :sob:", | |
"attachments": [{ | |
"color": "danger" | |
}] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |