Archived
75 lines
2.0 KiB
YAML
75 lines
2.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: "Semver bump (patch, minor, major)"
|
|
required: false
|
|
default: "patch"
|
|
push:
|
|
branches:
|
|
- release
|
|
|
|
jobs:
|
|
build-and-release:
|
|
if: github.actor != 'github-actions[bot]'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: true
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Bump version and tag
|
|
id: bump
|
|
env:
|
|
BUMP: ${{ inputs.bump }}
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
npm version "${BUMP:-patch}" -m "chore: release %s"
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
git push
|
|
git push --tags
|
|
|
|
- name: Build x64 artifacts
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npx electron-builder --linux AppImage deb --x64
|
|
|
|
- name: Collect x64 artifacts
|
|
run: |
|
|
mkdir -p dist-final
|
|
mv dist/*.AppImage dist/*.deb dist-final/ 2>/dev/null || true
|
|
|
|
- name: Build arm64 artifacts
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npx electron-builder --linux AppImage deb --arm64
|
|
|
|
- name: Collect arm64 artifacts
|
|
run: mv dist/*.AppImage dist/*.deb dist-final/ 2>/dev/null || true
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: v${{ steps.bump.outputs.version }}
|
|
name: Linear v${{ steps.bump.outputs.version }}
|
|
draft: false
|
|
prerelease: false
|
|
files: dist-final/*
|