codex-proxy / .github /workflows /release.yml
icebear0828
ci: trigger release via workflow_dispatch to fix GITHUB_TOKEN limitation
20b98cc
raw
history blame
3.33 kB
name: Release Electron App
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v1.0.11)"
required: true
type: string
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win
artifact: windows
- os: macos-latest
platform: mac
artifact: macos
- os: ubuntu-latest
platform: linux
artifact: linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install root dependencies
run: npm ci --ignore-scripts
- name: Setup curl-impersonate
run: npx tsx scripts/setup-curl.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install web dependencies
run: cd web && npm ci
- name: Install desktop dependencies
run: cd desktop && npm ci
- name: Build app
run: npm run app:build
- name: Pack (${{ matrix.platform }})
run: npx electron-builder --config electron-builder.yml --${{ matrix.platform }} --publish never
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.artifact }}
path: |
release/*.exe
release/*.dmg
release/*.AppImage
release/*.yml
release/*.yaml
if-no-files-found: ignore
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || inputs.tag
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Resolve tag
id: tag
run: |
TAG="${{ inputs.tag || github.ref_name }}"
echo "name=$TAG" >> "$GITHUB_OUTPUT"
- name: Generate release notes
id: notes
run: |
TAG="${{ steps.tag.outputs.name }}"
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | grep -v "^${TAG}$" | head -1)
if [ -z "$PREV_TAG" ]; then
BODY="Initial release"
else
BODY=$(git log "${PREV_TAG}..${TAG}" --no-merges --pretty=format:"%s" \
| grep -vE "^(chore|docs|ci)(\(.*\))?:" \
| sed 's/^/- /')
if [ -z "$BODY" ]; then
BODY="Bug fixes and improvements"
fi
fi
{
echo "NOTES<<EOFNOTES"
echo "$BODY"
echo "EOFNOTES"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.name }}
body: ${{ steps.notes.outputs.NOTES }}
draft: false
prerelease: false
files: artifacts/*