Skip to content

Commit fdcd03d

Browse files
committed
re-add nightly releases
Update build.yml
1 parent 803fb5d commit fdcd03d

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

.github/workflows/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,80 @@ 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
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: replace ONLY the version token between hyphens with 'nightly', keep platform + extension
135+
- name: Normalize nightly filenames (preserve platform + extension)
136+
shell: bash
137+
run: |
138+
set -euo pipefail
139+
shopt -s nullglob
140+
for f in upload/*; do
141+
base="$(basename "$f")"
142+
ext=""; stem="$base"
143+
if [[ "$base" == *.* ]]; then
144+
ext=".${base##*.}" # extension incl. dot
145+
stem="${base%.*}" # name without extension
146+
fi
147+
# Replace the first hyphen-delimited numeric version token with 'nightly'
148+
# Example: wurst-compiler-1.8.1.0-linux-x64 -> wurst-compiler-nightly-linux-x64
149+
new_stem="$(echo "$stem" | sed -E 's/-[0-9]+(\.[0-9]+)*-/-nightly-/' )"
150+
new="${new_stem}${ext}"
151+
if [[ "$base" != "$new" ]]; then
152+
mv -f "upload/$base" "upload/$new"
153+
fi
154+
done
155+
echo "After rename:"
156+
ls -alh upload
157+
158+
- name: Publish Nightly Release (rolling 'nightly' tag)
159+
uses: softprops/action-gh-release@v2
160+
with:
161+
tag_name: nightly
162+
name: Nightly Build (master)
163+
prerelease: true
164+
draft: false
165+
make_latest: false
166+
generate_release_notes: false
167+
body: |
168+
Nightly build for the latest commit on `master`.
169+
This release is automatically updated in-place (same tag).
170+
files: |
171+
upload/**
172+
fail_on_unmatched_files: false
173+
env:
174+
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)