-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (107 loc) · 3.73 KB
/
release.yml
File metadata and controls
130 lines (107 loc) · 3.73 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
name: Build & Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
env:
RETOC_VERSION: "v0.1.5"
UASSETTOOL_VERSION: "v1.2.0"
jobs:
# Windows build ─
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller
run: pyinstaller build.spec --noconfirm --clean
- name: Zip release folder
run: Compress-Archive -Path dist\RivalsSwapper\* -DestinationPath dist\RivalsSwapper-Windows.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: RivalsSwapper-Windows
path: dist/RivalsSwapper-Windows.zip
# Linux build
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-tk
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
# Committed tools/ contains Windows binaries.
# Replace retoc and UAssetTool with their Linux equivalents.
- name: Download retoc (Linux)
run: |
mkdir -p _retoc_tmp
curl -sL "https://github.com/trumank/retoc/releases/download/${{ env.RETOC_VERSION }}/retoc_cli-x86_64-unknown-linux-gnu.tar.xz" | tar -xJ -C _retoc_tmp
find _retoc_tmp -type f -name "retoc" -exec cp {} tools/retoc/retoc \;
chmod +x tools/retoc/retoc
rm -rf _retoc_tmp
- name: Download UAssetTool (Linux)
run: |
curl -sL "https://github.com/XzantGaming/UAssetToolRivals/releases/download/${{ env.UASSETTOOL_VERSION }}/UAssetTool-linux-x64.tar.gz" | tar -xz -C tools/uassettool
chmod +x tools/uassettool/UAssetTool
- name: Build with PyInstaller
run: pyinstaller build.spec --noconfirm --clean
- name: Archive release folder
run: tar -czf dist/RivalsSwapper-Linux.tar.gz -C dist RivalsSwapper
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: RivalsSwapper-Linux
path: dist/RivalsSwapper-Linux.tar.gz
# Create GitHub Release
release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: RivalsSwapper-Windows
path: artifacts
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: RivalsSwapper-Linux
path: artifacts
- name: Determine tag
id: tag
run: |
VERSION=$(python -c 'import sys; sys.path.insert(0, "src"); from _version import __version__; print(__version__)')
echo "TAG_NAME=v${VERSION}" >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.TAG_NAME }}
name: Rivals Swapper ${{ steps.tag.outputs.TAG_NAME }}
draft: false
prerelease: false
generate_release_notes: true
files: |
artifacts/RivalsSwapper-Windows.zip
artifacts/RivalsSwapper-Linux.tar.gz