Skip to content

🚀 Release

🚀 Release #4

Workflow file for this run

name: 🚀 Release
on:
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Verify main branch
run: |
if [[ "${{ github.ref_name }}" != "main" ]]; then
echo "Release can only be done on the main branch."
exit 1
fi
- name: Checkout project
uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
- name: Install dependencies
run: pnpm install
- name: Build package
run: pnpm build
- name: Sign package
working-directory: dist
run: |
if [[ -z "${{ secrets.PRIVATE_KEY }}" ]]; then
echo "Set an ed25519 key as PRIVATE_KEY in GitHub Action secret to sign."
else
echo "${{ secrets.PRIVATE_KEY }}" > private_key.pem
openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip
rm private_key.pem
fi
- name: Check version
id: meta
working-directory: dist
run: |
VERSION=$(unzip -p plugin_package.zip manifest.json | jq -r .version)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Create release
uses: caido/action-release@v1
with:
tag: ${{ steps.meta.outputs.version }}
commit: ${{ github.sha }}
body: 'Release ${{ steps.meta.outputs.version }}'
artifacts: 'dist/plugin_package.zip,dist/plugin_package.zip.sig'
generateReleaseNotes: true
immutableCreate: true