Skip to content

Merge pull request #2 from yibailiu/dev #46

Merge pull request #2 from yibailiu/dev

Merge pull request #2 from yibailiu/dev #46

name: Build and Release
on:
push:
branches:
- main
- dev
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
env:
VIDEOMERGE_FFMPEG_DARWIN_SHA256: ${{ vars.VIDEOMERGE_FFMPEG_DARWIN_SHA256 }}
VIDEOMERGE_FFPROBE_DARWIN_SHA256: ${{ vars.VIDEOMERGE_FFPROBE_DARWIN_SHA256 }}
VIDEOMERGE_FFMPEG_WINDOWS_SHA256: ${{ vars.VIDEOMERGE_FFMPEG_WINDOWS_SHA256 }}
VIDEOMERGE_FFMPEG_LINUX_SHA256: ${{ vars.VIDEOMERGE_FFMPEG_LINUX_SHA256 }}
jobs:
build:
name: Build ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows-x64
artifact_name: VideoMergingTool-windows-x64
package_path: dist/installer/VideoMergingTool-Setup.exe
- os: macos-15-intel
label: macos-intel
artifact_name: VideoMergingTool-macos-intel
package_path: dist/VideoMergingTool-macos-intel.dmg
- os: macos-14
label: macos-apple-silicon
artifact_name: VideoMergingTool-macos-apple-silicon
package_path: dist/VideoMergingTool-macos-apple-silicon.dmg
- os: ubuntu-latest
label: linux-x64
artifact_name: VideoMergingTool-linux-x64
package_path: dist/VideoMergingTool
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build dependencies
run: python -m pip install -r requirements-build.txt
- name: Install Inno Setup on Windows
if: runner.os == 'Windows'
run: choco install innosetup --no-progress -y
- name: Build executable on Windows
if: runner.os == 'Windows'
shell: pwsh
env:
WINDOWS_CERTIFICATE_BASE64: ${{ secrets.WINDOWS_CERTIFICATE_BASE64 }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
run: .\scripts\build_windows.ps1
- name: Build app on macOS
if: runner.os == 'macOS'
run: |
bash scripts/build_local.sh
mv dist/VideoMergingTool.dmg "${{ matrix.package_path }}"
- name: Build executable on Linux
if: runner.os == 'Linux'
run: bash scripts/build_local.sh
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.package_path }}
if-no-files-found: error
release:
name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: release-assets/**/*
generate_release_notes: true