Skip to content

Release

Release #188

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
required: true
description: 'Release version'
jobs:
release_pr:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Fetch files and checkout
run: |
git fetch origin
# Check if the 'main' branch exists, if not, create it
if git rev-parse --verify main >/dev/null 2>&1; then
git checkout main
else
git checkout -b main origin/main
fi
# Check if the 'releases' branch exists, if not, create it
if git rev-parse --verify releases >/dev/null 2>&1; then
git checkout releases
else
git checkout -b releases origin/releases
fi
# Checkout the code of main onto releases
git checkout main -- .
- name: Build release
run: |
npm ci
npm run build
- name: Check in files
run: |
git add -f build/ Sources/
- name: Commit build files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release build ${{ github.event.inputs.version }} [ci release]"
commit_options: '--allow-empty'
skip_checkout: true
branch: "releases"
- name: Collect commit ranges
run: |
bash ./scripts/changelog.sh > ${{ github.workspace }}/CHANGELOG.txt
- name: Debug changelog file
run: |
ls -la ${{ github.workspace }}/CHANGELOG.txt
cat ${{ github.workspace }}/CHANGELOG.txt
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}/CHANGELOG.txt
draft: false
prerelease: false
tag_name: ${{ github.event.inputs.version }}
target_commitish: "releases"