-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (102 loc) · 3.1 KB
/
build-release.yml
File metadata and controls
118 lines (102 loc) · 3.1 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
name: Build and Release
on:
push:
tags:
- 'v*' # Trigger on version tags
workflow_dispatch: # Allow manual triggering
permissions:
contents: write
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -e .
- name: Build executable
run: |
python package.py
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: pubgmhud-external-api
path: dist/pubgmhud-external-api
retention-days: 1
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -e .
- name: Build executable
run: |
python package.py
- name: List dist contents (debug)
run: dir dist
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: pubgmhud-external-api-windows
path: dist/pubgmhud-external-api.exe
retention-days: 1
release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts (Linux)
uses: actions/download-artifact@v4
with:
name: pubgmhud-external-api
path: dist/linux/
- name: Download build artifacts (Windows)
uses: actions/download-artifact@v4
with:
name: pubgmhud-external-api-windows
path: dist/windows/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/linux/pubgmhud-external-api
asset_name: pubgmhud-external-api-linux
asset_content_type: application/octet-stream
- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/windows/pubgmhud-external-api.exe
asset_name: pubgmhud-external-api-windows.exe
asset_content_type: application/octet-stream