Skip to content

Scout v10.3 support (stable; dry-run) #60

Scout v10.3 support (stable; dry-run)

Scout v10.3 support (stable; dry-run) #60

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
type:
description: Type
type: choice
required: true
default: stable
options:
- stable
- rc
- beta
- alpha
name:
description: Name
type: string
required: true
description:
description: Description
type: string
required: false
dry-run:
description: Dry run?
type: boolean
required: true
default: true
run-name: "${{ inputs.name }} (${{ inputs.type }}${{ inputs.dry-run && '; dry-run' || ''}})"
permissions:
contents: read
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.release.outputs.version }}
steps:
# Bot cannot sign tags/commits yet
# https://github.com/actions/runner/issues/667
- name: Import GPG key
id: gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: ./.github/actions/npm
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ runner.temp }}/VERSION"
CHANGELOG="${{ runner.temp }}/CHANGELOG.md"
npm run release -- \
${{ inputs.type != 'stable' && format('--preRelease="{0}"', inputs.type) || ''}} \
${{ inputs.dry-run && '--dry-run' || ''}} \
--release.name="${{ inputs.name }}" \
--release.description="${{ inputs.description }}" \
--dump.version="$VERSION" \
--dump.changelog="$CHANGELOG"
echo "version=$(cat $VERSION)" >> $GITHUB_OUTPUT
cat "$CHANGELOG" >> $GITHUB_STEP_SUMMARY
congrat:
name: Congratulations
runs-on: ubuntu-latest
needs:
- release
steps:
- name: Summary
if: ${{ !inputs.dry-run }}
run: |
echo "Version **[${{ needs.release.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/${{ needs.release.outputs.version }})** released! :rocket:" >> $GITHUB_STEP_SUMMARY
- name: Summary (dry-run)
if: ${{ inputs.dry-run }}
run: |
echo "Version **${{ needs.release.outputs.version }}** will be released! 🔥" >> $GITHUB_STEP_SUMMARY