Skip to content

Commit 51fbfab

Browse files
committed
ci: add auto-release workflow for tags
1 parent 5ad81e4 commit 51fbfab

File tree

1 file changed

+44
-34
lines changed

1 file changed

+44
-34
lines changed
Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
name: Build for Windows
2-
3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
8-
9-
jobs:
10-
build:
11-
runs-on: windows-latest
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.12'
20-
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install pyinstaller
25-
26-
- name: Build Windows with PyInstaller
27-
run: |
28-
pyinstaller --windowed --onefile remove_shader_cache.py
29-
30-
- name: Upload Windows artifact
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: ShaderCacheRemover-Windows
34-
path: dist/remove_shader_cache.exe
1+
name: Build for Windows
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
tags: [ 'v*' ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
jobs:
14+
build:
15+
runs-on: windows-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pyinstaller
29+
30+
- name: Build Windows with PyInstaller
31+
run: |
32+
pyinstaller --windowed --onefile remove_shader_cache.py
33+
34+
- name: Upload Windows artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: ShaderCacheRemover-Windows
38+
path: dist/remove_shader_cache.exe
39+
40+
- name: Release
41+
uses: softprops/action-gh-release@v1
42+
if: startsWith(github.ref, 'refs/tags/')
43+
with:
44+
files: dist/remove_shader_cache.exe

0 commit comments

Comments
 (0)