Skip to content

Autumn Evolution 🍂 (stable) #115

Autumn Evolution 🍂 (stable)

Autumn Evolution 🍂 (stable) #115

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@v6
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@v4
with:
fetch-depth: 0
- name: Install Node.js
uses: ./.github/actions/npm
- name: Install PHP
if: ${{ !inputs.dry-run }}
uses: ./.github/actions/php
with:
working-directory: dev
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ runner.temp }}/VERSION"
CHANGELOG="${{ runner.temp }}/CHANGELOG.md"
DESCRIPTION=$(cat << 'EOF'
${{ inputs.description }}
EOF
)
npm run release -- \
${{ inputs.type != 'stable' && format('--preRelease="{0}"', inputs.type) || ''}} \
${{ inputs.dry-run && '--dry-run' || ''}} \
--release.name='${{ inputs.name }}' \
--release.description="$DESCRIPTION" \
--dump.version="$VERSION" \
--dump.changelog="$CHANGELOG" \
--verbose
echo "version=$(cat $VERSION)" >> $GITHUB_OUTPUT
cat "$CHANGELOG" >> $GITHUB_STEP_SUMMARY
packages:
if: ${{ !inputs.dry-run }}
uses: ./.github/workflows/packages.yml
needs:
- release
secrets: inherit
congrat:
name: Congratulations
if: ${{ !failure() }}
runs-on: ubuntu-latest
needs:
- release
- packages
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