-
Notifications
You must be signed in to change notification settings - Fork 38
157 lines (133 loc) · 5.05 KB
/
Copy pathapp.yml
File metadata and controls
157 lines (133 loc) · 5.05 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: AutoSubSync
on:
workflow_dispatch:
env:
DIST_DIR: /tmp/builds
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-13]
include:
- os: windows-latest
build: win-x64
file_name: win_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 }}
sync_tools_info: ${{ steps.set-version.outputs.sync_tools_info }}
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 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
$version = $json.AutoSubSync
$ffmpeg_version = $json.ffmpeg
# Build sync tools info string
$sync_tools_info = ""
foreach ($tool in $json.sync_tools.PSObject.Properties.Name) {
$tool_version = $json.sync_tools.$tool.version
$tool_github = $json.sync_tools.$tool.github
$sync_tools_info += ">[${tool}](${tool_github}): ${tool_version}`n"
}
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "ffmpeg_version=$ffmpeg_version" >> $env:GITHUB_OUTPUT
echo "sync_tools_info<<EOF" >> $env:GITHUB_OUTPUT
echo $sync_tools_info >> $env:GITHUB_OUTPUT
echo "EOF" >> $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
*.AppImage
build-linux-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Build using build.py with Python 3.12 in Docker
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \
--env DEBIAN_FRONTEND=noninteractive \
--env TZ=Etc/UTC \
--privileged \
--entrypoint bash \
python:3.12.8-slim \
-c "apt-get update && \
apt-get install -y tzdata file fuse libfuse2 tk-dev libglib2.0-0 libxkbcommon-x11-0 libxcb-xinerama0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xkb1 libxrender1 libsm6 libxext6 libx11-xcb1 libdbus-1-3 libxcb-sync1 libxcb-glx0 libgdk-pixbuf2.0-0 libgtk-3-0 libpango-1.0-0 libcairo2 libatk1.0-0 libpangocairo-1.0-0 libcairo-gobject2 && \
echo 'GLIBC Version:' && \
ldd --version | head -n 1 && \
pip install --upgrade pip setuptools wheel requests pyinstaller && \
python build.py"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-linux_amd64
path: |
*.AppImage
*.tar.gz
release:
needs: [build, build-linux-ubuntu]
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 the [instructions](https://github.com/denizsafak/AutoSubSync?tab=readme-ov-file#macos).
>Included:
>[ffmpeg](https://github.com/FFmpeg/FFmpeg): ${{ needs.build.outputs.ffmpeg_version }}
${{ needs.build.outputs.sync_tools_info }}
files: ${{ env.DIST_DIR }}/*
generate_release_notes: false
draft: true
overwrite: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}