-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (134 loc) · 4.42 KB
/
Copy pathrelease.yml
File metadata and controls
154 lines (134 loc) · 4.42 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
name: Build and Draft Release
on:
push:
branches:
- main
jobs:
build:
name: Build (${{ matrix.target_os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target_os: linux
artifact_name: cpe-build-linux
- os: windows-latest
target_os: windows
artifact_name: cpe-build-windows
- os: macos-latest
target_os: macos
artifact_name: cpe-build-macos
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies (Linux)
if: matrix.target_os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev python3 python3-pil
- name: Install Dependencies (macOS)
if: matrix.target_os == 'macos'
run: |
brew install raylib python3
python3 -m pip install --break-system-packages pillow || python3 -m pip install pillow
- name: Setup MSYS2 (Windows)
if: matrix.target_os == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
zip
mingw-w64-x86_64-gcc
mingw-w64-x86_64-raylib
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-python
mingw-w64-x86_64-python-pillow
- name: Build Application (Linux / macOS)
if: matrix.target_os != 'windows'
run: |
make clean
make
- name: Build Application (Windows)
if: matrix.target_os == 'windows'
shell: msys2 {0}
run: |
make clean
make EXE=.exe
- name: Run Test Suite (Linux / macOS)
if: matrix.target_os != 'windows'
run: |
make test
- name: Run Test Suite (Windows)
if: matrix.target_os == 'windows'
shell: msys2 {0}
run: |
make test EXE=.exe
- name: Package Release Bundle (Linux)
if: matrix.target_os == 'linux'
run: |
mkdir -p dist
mkdir -p release_dist
cp cpe release_dist/
cp cpe.desktop release_dist/
cp cpe.png release_dist/
cp README.md release_dist/
tar -czvf dist/cpe-linux-amd64.tar.gz -C release_dist .
cp cpe dist/cpe-linux-amd64
- name: Package Release Bundle (macOS)
if: matrix.target_os == 'macos'
run: |
mkdir -p dist
mkdir -p release_dist
cp cpe release_dist/
cp README.md release_dist/
tar -czvf dist/cpe-macos-arm64.tar.gz -C release_dist .
cp cpe dist/cpe-macos-arm64
- name: Package Release Bundle (Windows)
if: matrix.target_os == 'windows'
shell: msys2 {0}
run: |
mkdir -p dist
mkdir -p release_dist
cp cpe.exe release_dist/
cp README.md release_dist/
cd release_dist && zip -r ../dist/cpe-windows-amd64.zip . && cd ..
cp cpe.exe dist/cpe-windows-amd64.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/*
create-draft-release:
name: Create Draft Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
pattern: cpe-build-*
merge-multiple: true
path: release_assets
- name: Create Draft Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
TAG_NAME="draft-${SHORT_SHA}"
# Delete existing release with same tag if re-run
gh release delete "${TAG_NAME}" --cleanup-tag --yes 2>/dev/null || true
gh release create "${TAG_NAME}" \
--draft \
--target "${{ github.sha }}" \
--title "ComfyPromptExtractor Draft Release (${SHORT_SHA})" \
--notes "Automated draft build of **ComfyPromptExtractor (CPE)** generated from commit \`${{ github.sha }}\` on \`main\`." \
release_assets/*