Skip to content

Commit 19fe6fa

Browse files
committed
re-add nightly releases
1 parent 803fb5d commit 19fe6fa

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

.github/workflows/build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,71 @@ jobs:
9595
de.peeeq.wurstscript/build/releases/*.sha256
9696
if-no-files-found: error
9797
retention-days: 7
98+
99+
nightly_release:
100+
name: Nightly prerelease (master)
101+
needs: build
102+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
103+
runs-on: ubuntu-latest
104+
permissions:
105+
contents: write # needed to publish a Release with GITHUB_TOKEN
106+
steps:
107+
- name: Download all packaged artifacts
108+
uses: actions/download-artifact@v4
109+
with:
110+
path: artifacts
111+
112+
# Copy only archives (skip .sha256 for nightly)
113+
- name: Gather files (zip + tar.gz, no checksums)
114+
shell: bash
115+
run: |
116+
set -euo pipefail
117+
mkdir -p upload
118+
find artifacts -type f \( -name '*.zip' -o -name '*.tar.gz' \) -print0 | xargs -0 -I{} cp "{}" upload/
119+
120+
# Ensure both Windows (.zip) and Linux (.tar.gz) exist
121+
- name: Verify we have both archive types
122+
shell: bash
123+
run: |
124+
shopt -s nullglob
125+
zips=(upload/*.zip)
126+
tars=(upload/*.tar.gz)
127+
echo "Found ${#zips[@]} zip(s) and ${#tars[@]} tar.gz file(s)."
128+
if (( ${#zips[@]} == 0 || ${#tars[@]} == 0 )); then
129+
echo "ERROR: Expected both .zip (Windows) and .tar.gz (Linux) artifacts."
130+
ls -alR upload || true
131+
exit 1
132+
fi
133+
134+
# Rename artifacts to include 'nightly' instead of version
135+
- name: Normalize nightly filenames
136+
shell: bash
137+
run: |
138+
shopt -s nullglob
139+
for f in upload/*; do
140+
base="$(basename "$f")"
141+
new="$(echo "$base" | sed -E 's/([0-9]+\.[0-9]+(\.[0-9]+)*([.-][0-9A-Za-z]+)*)/nightly/; s/--/-/g')"
142+
if [[ "$base" != "$new" ]]; then
143+
mv -f "upload/$base" "upload/$new"
144+
fi
145+
done
146+
echo "After rename:"
147+
ls -alh upload
148+
149+
- name: Publish Nightly Release (rolling 'nightly' tag)
150+
uses: softprops/action-gh-release@v2
151+
with:
152+
tag_name: nightly # reuse same tag; no new tag per run
153+
name: Nightly Build (master) # stable title
154+
prerelease: true
155+
draft: false
156+
make_latest: false
157+
generate_release_notes: false
158+
body: |
159+
Nightly build for the latest commit on `master`.
160+
This release is automatically updated in-place (same tag).
161+
files: |
162+
upload/**
163+
fail_on_unmatched_files: false # single glob; we've verified both types exist
164+
env:
165+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ name: Release slim runtimes (jlink)
33
on:
44
push:
55
tags:
6-
- 'v*' # e.g. v1.8.1.0
6+
- 'v*'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: write
11+
912
jobs:
1013
build:
1114
name: Build ${{ matrix.plat }}
1215
strategy:
1316
fail-fast: false
17+
# keep four platforms as you had
1418
matrix:
1519
include:
1620
- os: windows-latest
@@ -61,5 +65,10 @@ jobs:
6165
de.peeeq.wurstscript/build/releases/wurst-compiler-*-*.zip
6266
de.peeeq.wurstscript/build/releases/wurst-compiler-*-*.tar.gz
6367
de.peeeq.wurstscript/build/releases/*.sha256
68+
tag_name: ${{ github.ref_name }} # ensures assets attach to the pushed v* tag
69+
name: ${{ github.ref_name }}
70+
draft: false
71+
prerelease: false
72+
generate_release_notes: true
6473
env:
6574
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)