Manual Release #2
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: Manual Release | |
on: | |
workflow_dispatch: | |
inputs: | |
os: | |
description: 'Operating Systems (comma-separated, no spaces)' | |
required: false | |
default: 'ubuntu-latest,macos-latest,windows-latest' | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- id: set-matrix | |
run: | | |
INPUT_OS="${{ github.event.inputs.os }}" | |
MATRIX=$(echo "[\"$(echo ${INPUT_OS} | sed 's/,/","/g')\"]") | |
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT | |
build: | |
needs: generate-matrix | |
strategy: | |
matrix: | |
os: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
arch: [x64, arm64] | |
uses: ./.github/workflows/build-electron.yml | |
with: | |
os: ${{ matrix.os }} | |
arch: ${{ matrix.arch }} | |
secrets: inherit | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: . | |
merge-multiple: true # Merge files into the root | |
- name: Rename Files and Move to Release | |
run: | | |
mkdir -p release | |
for file in *; do | |
if [ -f "$file" ]; then | |
new_name=$(echo "$file" | sed -E 's/-[0-9]+\.[0-9]+\.[0-9]+//') | |
mv "$file" "release/$new_name" | |
fi | |
done | |
- name: Create Manual Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
name: manual-release | |
files: release/* # Correct path to the renamed files | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |