Skip to content

AutoSubSync

AutoSubSync #39

Workflow file for this run

name: AutoSubSync
on:
workflow_dispatch:
env:
DIST_DIR: /tmp/builds
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest, macos-13]
include:
- os: windows-latest
build: win-x64
file_name: win_amd64
- os: ubuntu-latest
build: linux-x64
file_name: linux_amd64
- os: macos-latest
build: osx-arm64
file_name: macos_arm64
- os: macos-13
build: macos-amd64
file_name: macos_amd64
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.set-version.outputs.version }}
ffmpeg_version: ${{ steps.set-version.outputs.ffmpeg_version }}
ffsubsync_version: ${{ steps.set-version.outputs.ffsubsync_version }}
alass_version: ${{ steps.set-version.outputs.alass_version }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.8
cache: "pip"
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y python3-venv python3-tk
- name: Set HOME environment variable (macOS)
if: startsWith(matrix.os, 'macos')
run: echo "HOME=$(eval echo ~$USER)" >> $GITHUB_ENV
- name: Install required modules globally
run: |
pip install requests
- name: Run build script
run: |
python build.py
- name: Parse versions.json (Windows)
if: matrix.os == 'windows-latest'
id: set-version
run: |
if (Test-Path main/resources/versions.json) {
$json = Get-Content -Raw -Path main/resources/versions.json | ConvertFrom-Json
echo "version=$($json.AutoSubSync)" >> $env:GITHUB_OUTPUT
echo "ffmpeg_version=$($json.ffmpeg)" >> $env:GITHUB_OUTPUT
echo "ffsubsync_version=$($json.ffsubsync)" >> $env:GITHUB_OUTPUT
echo "alass_version=$($json.alass)" >> $env:GITHUB_OUTPUT
} else {
Write-Host "versions.json not found"
}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.file_name }}
path: |
*.zip
*.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Download builds
uses: actions/download-artifact@v4
with:
path: ${{ env.DIST_DIR }}
pattern: build-*
merge-multiple: true
- name: Read CHANGELOG
id: read-changelog
run: |
changelog=$(cat CHANGELOG)
echo "changelog<<EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ needs.build.outputs.version }}"
name: "AutoSubSync v${{ needs.build.outputs.version }}"
body: |
${{ env.changelog }}
> MacOS users please read [this](https://github.com/denizsafak/AutoSubSync?tab=readme-ov-file#for-macososx-users).
>Included:
>[ffmpeg](https://github.com/FFmpeg/FFmpeg): ${{ needs.build.outputs.ffmpeg_version }}
>[ffsubsync](https://github.com/smacke/ffsubsync): ${{ needs.build.outputs.ffsubsync_version }}
>[alass](https://github.com/kaegi/alass): ${{ needs.build.outputs.alass_version }}
files: ${{ env.DIST_DIR }}/*
generate_release_notes: false
draft: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}