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 }}
0 commit comments