Create Release #9
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 Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number (e.g., 1.0.0)' | |
required: true | |
type: string | |
prerelease: | |
description: 'Is this a pre-release?' | |
required: true | |
type: boolean | |
default: false | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: | | |
bun install | |
bun add -g semantic-release @semantic-release/github @semantic-release/release-notes-generator | |
pip install -r requirements.txt | |
- name: Build and create zip | |
run: python helpers/build_zip.py | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.version }} | |
- name: Generate Release Notes | |
id: release_notes | |
run: | | |
NOTES=$(bun run semantic-release --dry-run | sed -n '/Release note for version.*:/,/---/p' | sed '$d') | |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | |
echo "$NOTES" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.version }} | |
name: Release ${{ github.event.inputs.version }} | |
body: ${{ env.RELEASE_NOTES }} | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} | |
files: SteamDB-plugin-${{ github.event.inputs.version }}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |