-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (92 loc) · 2.85 KB
/
release.yml
File metadata and controls
109 lines (92 loc) · 2.85 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag_name:
description: "Release tag to publish"
required: true
type: string
permissions:
contents: write
jobs:
build-linux:
name: Build Linux Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build release
run: ./py2c --auto-install assembleRelease --no-upx
- name: Prepare artifact
run: |
mkdir -p dist
cp release/downplay dist/downplay-linux-x86_64
sha256sum dist/downplay-linux-x86_64 > dist/SHA256SUMS-linux.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-release
path: dist/*
build-windows:
name: Build Windows Release
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Enable MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Build release
run: python py2c_windows.py --auto-install assembleRelease
- name: Prepare artifact
shell: pwsh
run: |
New-Item -ItemType Directory -Force dist | Out-Null
Copy-Item release\downplay.exe dist\downplay-windows-x64.exe
Get-FileHash dist\downplay-windows-x64.exe -Algorithm SHA256 | ForEach-Object { "$($_.Hash.ToLower()) downplay-windows-x64.exe" } | Set-Content dist\SHA256SUMS-windows.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-release
path: dist/*
publish:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs:
- build-linux
- build-windows
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: linux-release
path: dist/linux
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: windows-release
path: dist/windows
- name: Collect assets
run: |
mkdir -p dist/final
cp dist/linux/downplay-linux-x86_64 dist/final/
cp dist/linux/SHA256SUMS-linux.txt dist/final/
cp dist/windows/downplay-windows-x64.exe dist/final/
cp dist/windows/SHA256SUMS-windows.txt dist/final/
ls -la dist/final
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.ref_name }}
files: dist/final/*
generate_release_notes: true