Skip to content

Commit cd7f56f

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

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,59 @@ 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+
# grabs every artifact your matrix uploaded (keeps your names)
109+
uses: actions/download-artifact@v4
110+
with:
111+
path: artifacts
112+
113+
- name: Gather files
114+
shell: bash
115+
run: |
116+
mkdir -p upload
117+
# pick up what your existing packaging already produced
118+
find artifacts -type f \( -name '*.zip' -o -name '*.tar.gz' -o -name '*.sha256' \) -print0 | xargs -0 -I{} cp "{}" upload/
119+
120+
- name: Normalize nightly filenames
121+
shell: bash
122+
run: |
123+
# Copy artifacts into ./upload first (keep your existing step if you already do this)
124+
# Then rename: replace the first version-looking token with 'nightly'
125+
shopt -s nullglob
126+
for f in upload/*; do
127+
base="$(basename "$f")"
128+
new="$(echo "$base" | sed -E 's/([0-9]+\.[0-9]+(\.[0-9]+)*([.-][0-9A-Za-z]+)*)/nightly/; s/--/-/g')"
129+
# only rename if it actually changed and if it won't overwrite a different file type
130+
if [[ "$base" != "$new" ]]; then
131+
mv -f "upload/$base" "upload/$new"
132+
fi
133+
done
134+
135+
- name: Publish Nightly Release (rolling "nightly" tag)
136+
uses: softprops/action-gh-release@v2
137+
with:
138+
tag_name: nightly-master
139+
name: Nightly Build (master)
140+
prerelease: true
141+
draft: false
142+
make_latest: false
143+
generate_release_notes: false
144+
body: |
145+
Nightly build for the latest commit on `master`.
146+
This release is automatically updated in-place.
147+
files: |
148+
upload/*.zip
149+
upload/*.tar.gz
150+
upload/*.sha256
151+
fail_on_unmatched_files: true
152+
env:
153+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ 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 }}
@@ -63,3 +66,4 @@ jobs:
6366
de.peeeq.wurstscript/build/releases/*.sha256
6467
env:
6568
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+

0 commit comments

Comments
 (0)