-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 2.44 KB
/
main.yml
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
name: "Build & Release"
on:
push:
branches: main
jobs:
builds:
name: Build & Release
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# Setup Python
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install Pillow
pip install pyinstaller
# Build python script into a stand-alone exe
- name: Pyinstaller Build
run: |
pyinstaller Melodfy.spec
- name: Download 7zip
run: |
Invoke-WebRequest https://www.7-zip.org/a/7zr.exe -OutFile 7zr.exe
- name: Move model.onnx
run: |
mv models/model.onnx dist/Melodfy/_internal/models/
- name: Download ffmpeg-windows
run: |
Invoke-WebRequest https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.7z -OutFile ffmpeg-release-essentials.7z
./7zr.exe x ffmpeg-release-essentials.7z
mv ffmpeg-6.1.1-essentials_build/bin/ffmpeg.exe dist/Melodfy/_internal/
- name: Zip build
run: |
./7zr.exe a -t7z dist/Melodfy_${{ runner.os }}_Build_${{ github.run_number }}.7z dist/Melodfy
# Uploads artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Melodfy_${{ runner.os }}_Build_v${{ github.run_number }}
path: |
dist/Melodfy_${{ runner.os }}_Build_${{ github.run_number }}.7z
# Uploads artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Melodfy_${{ runner.os }}_Build_${{ github.run_number }}
path: |
dist/Melodfy_${{ runner.os }}_Build_${{ github.run_number }}.7z
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/Melodfy_${{ runner.os }}_Build_${{ github.run_number }}.7z"
tag: v1.0.0+${{github.run_number}}
token: ${{secrets.SECRET_KEY}}