-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (108 loc) · 4.84 KB
/
Copy pathrelease.yml
File metadata and controls
129 lines (108 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build releases
# Same triggers as the Episode III kit's workflow, one job per OS because
# PyInstaller does not cross-compile:
# * git tag matching v* — drafts a GitHub Release with both zips attached
# * manual workflow_dispatch — same zips as build artefacts (no Release)
# * pushes to main that touch packaging/code — smoke test only, no upload
#
# Much simpler than the Episode III workflow: this kit is stdlib-only, so
# there is no ffmpeg / 7-Zip to fetch and bundle.
on:
push:
tags: ['v*']
branches: [main]
paths:
- 'packaging/**'
- '.github/workflows/release.yml'
- '**.py'
workflow_dispatch:
permissions:
contents: write # needed for softprops/action-gh-release on tag pushes
env:
PYTHON_VERSION: '3.12' # match the Python the kit is developed and tested on
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install PyInstaller
run: python -m pip install --upgrade pip pyinstaller
# Latest BtbN GPL win64 ffmpeg -> packaging/tools/, picked up by the
# spec and bundled under tools/ (same approach as the Episode III kit).
- name: Download portable ffmpeg
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$headers = @{ 'User-Agent' = 'xenosaga1-extractor-release'; 'Authorization' = "Bearer $env:GH_TOKEN" }
$rel = Invoke-RestMethod -Uri 'https://api.github.com/repos/BtbN/FFmpeg-Builds/releases/latest' -Headers $headers
$asset = $rel.assets | Where-Object { $_.name -like 'ffmpeg-*-win64-gpl.zip' -and $_.name -notlike '*shared*' } | Select-Object -First 1
if (-not $asset) { throw "No matching ffmpeg asset in $($rel.tag_name)" }
$zip = "$env:RUNNER_TEMP/ffmpeg.zip"
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $zip -Headers $headers
Expand-Archive -Path $zip -DestinationPath "$env:RUNNER_TEMP/ffmpeg-unpacked"
$exe = Get-ChildItem -Path "$env:RUNNER_TEMP/ffmpeg-unpacked" -Recurse -Filter ffmpeg.exe | Select-Object -First 1
if (-not $exe) { throw "ffmpeg.exe not found in unpacked archive" }
Copy-Item $exe.FullName "packaging/tools/ffmpeg.exe"
- name: Build
run: python build.py --clean
- name: Create zip
shell: pwsh
run: Compress-Archive -Path "dist/Xenosaga-I-Extractor-windows/*" -DestinationPath "Xenosaga-I-Extractor-win64.zip"
- uses: actions/upload-artifact@v4
with:
name: Xenosaga-I-Extractor-win64
path: Xenosaga-I-Extractor-win64.zip
if-no-files-found: error
- name: Attach to GitHub Release (tag pushes only)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
draft: true
files: Xenosaga-I-Extractor-win64.zip
generate_release_notes: true
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install PyInstaller
run: python -m pip install --upgrade pip pyinstaller
# Static arm64 ffmpeg -> packaging/tools/, bundled under tools/ in
# the .app. martin-riedl.de publishes static macOS builds with a
# stable "latest" redirect.
- name: Download portable ffmpeg
run: |
curl -sL -o /tmp/ffmpeg.zip "https://ffmpeg.martin-riedl.de/redirect/latest/macos/arm64/release/ffmpeg.zip"
unzip -o -q /tmp/ffmpeg.zip -d packaging/tools/
chmod +x packaging/tools/ffmpeg
packaging/tools/ffmpeg -version | head -1
- name: Build
run: python build.py --clean
# ditto preserves the symlinks and exec bits inside the .app;
# Compress-Archive / plain zip -r do not.
- name: Create zip
run: ditto -c -k --keepParent "dist/Xenosaga-I-Extractor.app" "Xenosaga-I-Extractor-macos.zip"
- uses: actions/upload-artifact@v4
with:
name: Xenosaga-I-Extractor-macos
path: Xenosaga-I-Extractor-macos.zip
if-no-files-found: error
- name: Attach to GitHub Release (tag pushes only)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
draft: true
files: Xenosaga-I-Extractor-macos.zip
generate_release_notes: true
body: |
### macOS: first launch
The app is ad-hoc signed, not notarized. After unzipping,
right-click **Xenosaga-I-Extractor.app** → **Open** the first
time (or run `xattr -dr com.apple.quarantine Xenosaga-I-Extractor.app`).
After that it double-clicks normally.