Release #76
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: "Dry run" | |
required: false | |
default: true | |
type: boolean | |
workflow_run: | |
workflows: ["Code Quality"] | |
types: | |
- completed | |
branches: | |
- main | |
permissions: | |
contents: read # for checkout | |
jobs: | |
release: | |
name: Release code quality check | |
# Only release if the code quality check was successful or if the workflow was manually triggered | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_dispatch }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
with: | |
fetch-depth: 0 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@cb425203a562475bca039ba4dbf90c7f9ac790f4 # v4.1.0 | |
id: semantic # Need an `id` for output variables | |
with: | |
dry_run: ${{ inputs.dry_run }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Summary Published | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: | | |
cat << EOF | tee "$GITHUB_STEP_SUMMARY" | |
Release [${{ steps.semantic.outputs.new_release_version }}](https://github.com/semantic-release/github/releases/tag/${{ steps.semantic.outputs.new_release_git_tag }}) | |
[${{ steps.semantic.outputs.new_release_git_head }}](https://github.com/biosustain/code-quality-check/commit/${{ steps.semantic.outputs.new_release_git_head }}) | |
${{ steps.semantic.outputs.new_release_notes }} | |
EOF |