Skip to content

chore: fix release action #4

chore: fix release action

chore: fix release action #4

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
build-artifacts:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-15-intel
platform: darwin
arch: x64
artifact_name: darwin-x64
- os: macos-latest
platform: darwin
arch: arm64
artifact_name: darwin-arm64
- os: windows-latest
platform: win32
arch: x64
artifact_name: win32-x64
- os: windows-11-arm
platform: win32
arch: arm64
artifact_name: win32-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Build for ${{ matrix.platform }}-${{ matrix.arch }}
run: npm run pack
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List build artifacts
run: |
echo "Build artifacts:"
echo "${{ matrix.os }}" | grep -q "windows" && (
dir release\ /s 2>nul || echo "No release directory found"
dir release\*.exe /s 2>nul || echo "No .exe files found"
dir release\*.zip /s 2>nul || echo "No .zip files found"
) || (
ls -la release/ || echo "No release directory found"
find release/ -type f \( -name "*.dmg" -o -name "*.zip" -o -name "*.AppImage" \) || echo "No build artifacts found"
)
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}-${{ github.ref_name }}
path: |
release/*.dmg
release/*.exe
release/*.zip
release/*.AppImage
retention-days: 30
create-release:
needs: build-artifacts
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag information
id: tag_info
run: |
TAG_MESSAGE=$(git tag -l --format='%(contents)' ${{ github.ref_name }})
if [ -n "$TAG_MESSAGE" ]; then
echo "tag_message<<EOF" >> $GITHUB_OUTPUT
echo "$TAG_MESSAGE" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "tag_message=No description provided for this tag." >> $GITHUB_OUTPUT
fi
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
files: |
artifacts/darwin-x64-${{ github.ref_name }}/*
artifacts/darwin-arm64-${{ github.ref_name }}/*
artifacts/win32-x64-${{ github.ref_name }}/*
artifacts/win32-arm64-${{ github.ref_name }}/*
body: |
## Algo Bootstrap v${{ github.ref_name }}
${{ steps.tag_info.outputs.tag_message }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}