Skip to content

fix(build): update ffmpeg download URLs to master-latest naming #67

fix(build): update ffmpeg download URLs to master-latest naming

fix(build): update ffmpeg download URLs to master-latest naming #67

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32-x64
arch: x64
- os: ubuntu-latest
platform: linux-x64
arch: x64
- os: macos-latest
platform: darwin-arm64
arch: arm64
- os: macos-latest
platform: darwin-x64
arch: x64
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install 7zip (macOS x64 cross-compile)
if: matrix.platform == 'darwin-x64'
run: brew install p7zip
- name: Configure git to use HTTPS
run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
BINARY_PLATFORM: ${{ matrix.platform }}
- name: Build Electron App
run: yarn electron:build --${{ matrix.arch }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VITE_AMPLITUDE_API_KEY: ${{ secrets.VITE_AMPLITUDE_API_KEY }}
VITE_MIXPANEL_TOKEN: ${{ secrets.VITE_MIXPANEL_TOKEN }}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.platform }}
path: release/*
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release
merge-multiple: true
- name: List release files
run: ls -la release/
- name: Clean up existing release assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view ${{ github.ref_name }} > /dev/null 2>&1 || exit 0
echo "Release ${{ github.ref_name }} exists. Cleaning up assets..."
gh release view ${{ github.ref_name }} --json assets --jq '.assets[].name' | while read asset; do
echo "Deleting $asset..."
gh release delete-asset ${{ github.ref_name }} "$asset" -y
done
- name: Extract Changelog for Release
id: changelog
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}" # Remove 'v' prefix
# Extract content between this version and next version header
CHANGELOG=$(awk -v ver="$VERSION" '
/^## \[/ {
if (found) exit
if (index($0, "["ver"]")) found=1
next
}
found { print }
' CHANGELOG.md)
# Escape for GitHub Actions output
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
release/*.zip
release/*.dmg
release/*.AppImage
release/*.exe
body: ${{ steps.changelog.outputs.content }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}