-
-
Notifications
You must be signed in to change notification settings - Fork 3
184 lines (161 loc) · 5.27 KB
/
nightly_release.yml
File metadata and controls
184 lines (161 loc) · 5.27 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: 🌙 Nightly Builds
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build_linux_clang:
name: "🐧 Linux (Clang, Nightly)"
uses: ./.github/workflows/linux_build.yml
with:
jobName: "Linux Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-linux-x64-clang"
compiler: clang
fetchTags: true
secrets: inherit
build_linux_gcc:
name: "🐧 Linux (GCC, Nightly)"
uses: ./.github/workflows/linux_build.yml
with:
jobName: "Linux GCC Nightly Build"
artifactPrefixName: "myMCpp-nightly-linux-x64-gcc"
compiler: gcc
fetchTags: true
secrets: inherit
build_macos:
name: "🍎 macOS (Nightly)"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "macOS Nightly Build"
artifactPrefixName: "myMCpp-nightly-macos-universal"
fetchTags: true
secrets: inherit
build_windows_x64_clang:
name: "🪟 Windows x64 (Clang, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows x64 Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-x64-clang"
platform: x64
compiler: clang
fetchTags: true
secrets: inherit
build_windows_x64_msvc:
name: "🪟 Windows x64 (MSVC, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows x64 MSVC Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-x64-msvc"
platform: x64
compiler: msvc
fetchTags: true
secrets: inherit
build_windows_arm64_clang:
name: "🪟 Windows ARM64 (Clang, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows ARM64 Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-arm64-clang"
os: windows-11-arm
platform: ARM64
compiler: clang
fetchTags: true
secrets: inherit
build_windows_arm64_msvc:
name: "🪟 Windows ARM64 (MSVC, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows ARM64 MSVC Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-arm64-msvc"
os: windows-11-arm
platform: ARM64
compiler: msvc
fetchTags: true
secrets: inherit
nightly_release:
name: "📦 Create Nightly Pre-Release"
runs-on: ubuntu-latest
needs:
- build_linux_clang
- build_linux_gcc
- build_macos
- build_windows_x64_clang
- build_windows_x64_msvc
- build_windows_arm64_clang
- build_windows_arm64_msvc
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Determine nightly tag
id: nightly_tag
shell: bash
run: |
DATE="$(date +'%Y%m%d')"
TAG="nightly-${DATE}"
NAME="myMCpp Nightly ${DATE}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "name=${NAME}" >> "$GITHUB_OUTPUT"
- name: Download all artifacts
uses: actions/download-artifact@v8.0.1
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts/
- name: Prepare release assets
shell: bash
run: |
mkdir -p release-assets
TAG="${{ steps.nightly_tag.outputs.tag }}"
for dir in artifacts/*/; do
dirname="$(basename "$dir")"
# Skip symbol artifacts
if [[ "$dirname" == *"-symbols" ]]; then
continue
fi
echo "Processing: $dirname"
# Windows artifacts: zip the directory contents
if [[ "$dirname" == *"windows"* ]]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.zip"
echo " -> Creating $asset_name"
cd "$dir"
zip -r "../../release-assets/$asset_name" ./*
cd ../..
# macOS artifacts: move the .tar.xz as-is
elif [[ "$dirname" == *"macos"* ]]; then
for f in "$dir"*.tar.xz; do
if [ -f "$f" ]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.tar.xz"
echo " -> Moving to $asset_name"
cp "$f" "release-assets/$asset_name"
fi
done
# Linux artifacts: move AppImage as-is
elif [[ "$dirname" == *"linux"* ]]; then
for f in "$dir"*.AppImage; do
if [ -f "$f" ]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.AppImage"
echo " -> Moving to $asset_name"
cp "$f" "release-assets/$asset_name"
fi
done
fi
done
echo ""
echo "=== Final release assets ==="
ls -la release-assets/
- name: Create GitHub pre-release with assets
uses: softprops/action-gh-release@v2.5.0
with:
tag_name: ${{ steps.nightly_tag.outputs.tag }}
name: ${{ steps.nightly_tag.outputs.name }}
target_commitish: ${{ github.sha }}
prerelease: true
draft: false
make_latest: false
generate_release_notes: true
files: |
release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}