-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (137 loc) · 4.8 KB
/
Copy pathrelease.yml
File metadata and controls
166 lines (137 loc) · 4.8 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
158
159
160
161
162
163
164
165
166
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
attestations: write
jobs:
validate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: python -m pip install -r requirements.txt -r requirements-dev.txt
- name: Validate release
run: |
python scripts/check_version.py --tag "${{ github.ref_name }}"
python -m ruff check .
python tests.py
python integration_tests.py
- name: Generate software bill of materials
run: python scripts/generate_sbom.py
- uses: actions/upload-artifact@v7
with:
name: release-sbom
path: UnityScraper-SBOM.cdx.json
windows:
runs-on: windows-latest
needs: validate
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: python -m pip install -r requirements.txt pyinstaller
- name: Build executable
run: python -m PyInstaller --clean --noconfirm UnityScraper.spec
- name: Package Windows release
shell: pwsh
run: |
New-Item -ItemType Directory -Path package | Out-Null
Copy-Item dist\UnityScraper.exe, README.md, CHANGELOG.md, LICENSE, DOCS_INDEX.md, BACKUP_MANAGER.md, COLLECTION_INTELLIGENCE.md, COMMUNITY_HUB.md, CONSOLE_SYNC.md, KNOWLEDGE_SOURCES.md, LINUX.md, PLUGIN_API.md, PROFILE_INTELLIGENCE.md, PROFILES_AND_SAVES.md, RELEASE_TOOLKIT.md, SECURITY.md, THIRD_PARTY_NOTICES.md package\
Compress-Archive -Path package\* -DestinationPath UnityScraper-Windows-x64.zip
$hash = (Get-FileHash UnityScraper-Windows-x64.zip -Algorithm SHA256).Hash.ToLower()
"$hash *UnityScraper-Windows-x64.zip" | Set-Content UnityScraper-Windows-x64.zip.sha256
- uses: actions/upload-artifact@v7
with:
name: release-windows
path: |
UnityScraper-Windows-x64.zip
UnityScraper-Windows-x64.zip.sha256
linux:
runs-on: ubuntu-22.04
needs: validate
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install desktop build dependencies
run: |
sudo apt-get update
sudo apt-get install -y appstream desktop-file-utils python3-tk
python -m pip install -r requirements.txt pyinstaller
- name: Validate desktop metadata
run: |
sed -e 's|@EXEC@|/usr/bin/unityscraper|g' \
-e 's|@ICON@|io.github.trapemall.UnityScraper|g' \
packaging/linux/io.github.trapemall.UnityScraper.desktop \
> /tmp/io.github.trapemall.UnityScraper.desktop
desktop-file-validate /tmp/io.github.trapemall.UnityScraper.desktop
appstreamcli validate --no-net packaging/linux/io.github.trapemall.UnityScraper.metainfo.xml
- name: Build Linux release
run: ./build_linux.sh
- uses: actions/upload-artifact@v7
with:
name: release-linux
path: |
dist/UnityScraper-Linux-x86_64.tar.gz
dist/UnityScraper-Linux-x86_64.tar.gz.sha256
macos:
runs-on: macos-14
needs: validate
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: python -m pip install -r requirements.txt pyinstaller
- name: Build macOS release
run: ./build_macos.sh
- uses: actions/upload-artifact@v7
with:
name: release-macos
path: |
dist/UnityScraper-macOS-arm64.tar.gz
dist/UnityScraper-macOS-arm64.tar.gz.sha256
publish:
runs-on: ubuntu-latest
needs: [validate, windows, linux, macos]
steps:
- uses: actions/download-artifact@v8
with:
pattern: release-*
path: release
merge-multiple: true
- name: Attest release artifacts
uses: actions/attest-build-provenance@v4
with:
subject-path: "release/*"
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
args=(
release create "${{ github.ref_name }}"
release/*
--repo "${{ github.repository }}"
--title "UnityScraper ${{ github.ref_name }}"
--generate-notes
--verify-tag
)
if [[ "${{ github.ref_name }}" == *-* ]]; then
args+=(--prerelease)
fi
gh "${args[@]}"