Skip to content

Commit 4ff8cff

Browse files
committed
build: update nightly release tag
1 parent 8956f57 commit 4ff8cff

1 file changed

Lines changed: 68 additions & 6 deletions

File tree

.github/workflows/releases.yml

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ permissions:
3939
contents: write
4040

4141
name: releases
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || 'nightly' }}
45+
cancel-in-progress: true
46+
4247
jobs:
4348
tag:
4449
name: prepare tag
@@ -53,7 +58,8 @@ jobs:
5358
steps:
5459
- uses: actions/checkout@v6
5560
with:
56-
ref: ${{ github.ref }}
61+
ref: ${{ github.sha }}
62+
fetch-depth: 0
5763

5864
#- name: Get previous tag
5965
# id: previousTag
@@ -90,6 +96,21 @@ jobs:
9096
echo "releaseKind=$release_kind" >> "$GITHUB_OUTPUT"
9197
echo "buildTime=$(date '+%Y.%m.%d')" >> "$GITHUB_OUTPUT"
9298
99+
- name: Move nightly tag to this commit
100+
if: ${{ steps.meta.outputs.releaseKind == 'nightly' }}
101+
shell: bash
102+
run: |
103+
set -euo pipefail
104+
105+
git config user.name "github-actions[bot]"
106+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
107+
108+
tag="${{ steps.meta.outputs.releaseTag }}"
109+
110+
git fetch --force --tags origin
111+
git tag -fa "$tag" "$GITHUB_SHA" -m "$tag: $GITHUB_SHA"
112+
git push --force origin "refs/tags/$tag:refs/tags/$tag"
113+
93114
build:
94115
name: prepare release
95116
if: ${{ github.actor != 'dependabot[bot]' }}
@@ -133,7 +154,7 @@ jobs:
133154
steps:
134155
- uses: actions/checkout@v6
135156
with:
136-
ref: ${{ github.ref }}
157+
ref: ${{ github.sha }}
137158

138159
- name: Setup Golang with cache
139160
uses: magnetikonline/action-golang-cache@v5
@@ -439,14 +460,55 @@ jobs:
439460
fi
440461
echo "Successfully prepared assets for deployment"
441462
463+
- name: Stage release artifacts
464+
if: ${{ steps.artifacts.outputs.artifact != '' }}
465+
shell: bash
466+
run: |
467+
set -euo pipefail
468+
mkdir -p release-files
469+
470+
cp -v "${{ steps.artifacts.outputs.artifact }}" release-files/
471+
472+
if [ "${{ matrix.cfg.runner_os }}" = "linux" ] && \
473+
[ -n "${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}" ]; then
474+
cp -v "${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}" release-files/
475+
fi
476+
477+
- name: Upload release artifacts
478+
if: ${{ steps.artifacts.outputs.artifact != '' }}
479+
uses: actions/upload-artifact@v4
480+
with:
481+
name: release-${{ matrix.cfg.runner_os }}
482+
path: release-files/*
483+
if-no-files-found: error
484+
485+
release:
486+
name: publish release
487+
if: ${{ github.actor != 'dependabot[bot]' }}
488+
needs: [tag, build]
489+
runs-on: ubuntu-latest
490+
steps:
491+
- name: Download release artifacts
492+
uses: actions/download-artifact@v4
493+
with:
494+
pattern: release-*
495+
path: release-assets
496+
merge-multiple: true
497+
498+
- name: List release artifacts
499+
shell: bash
500+
run: |
501+
set -euo pipefail
502+
find release-assets -maxdepth 1 -type f -print -exec ls -lh {} \;
503+
442504
- name: Update dev release
443-
if: "${{ needs.tag.outputs.releaseKind == 'nightly' && steps.artifacts.outputs.artifact != '' }}"
505+
if: ${{ needs.tag.outputs.releaseKind == 'nightly' }}
444506
uses: ncipollo/release-action@v1
445507
with:
446508
token: ${{ secrets.IKEMEN_TOKEN }}
447509
allowUpdates: true
448510
artifactErrorsFailBuild: true
449-
artifacts: "${{ steps.artifacts.outputs.artifact }}${{ matrix.cfg.runner_os == 'linux' && format(',{0}', steps.artifacts_ffmpeg.outputs.artifact_ffsrc) || '' }}"
511+
artifacts: "release-assets/*"
450512
body: |
451513
The nightly release, or more precisely, the latest development version, is generated after each commit and always represents the most up-to-date iteration of the source code. It features the newest development version of the engine and screenpack files, making it ready for testing straightaway. Using it can eliminate the need to compile the source code for the latest, cutting-edge updates. However, as a consequence, it may sometimes contain regressions that were not yet discovered and/or outpace the documentation that corresponds to stable releases with version numbers like v x.x.x.
452514
discussionCategory: ""
@@ -468,13 +530,13 @@ jobs:
468530
updateOnlyUnreleased: false
469531

470532
- name: Create Release
471-
if: "${{ needs.tag.outputs.releaseKind != 'nightly' && steps.artifacts.outputs.artifact != '' }}"
533+
if: ${{ needs.tag.outputs.releaseKind != 'nightly' }}
472534
uses: ncipollo/release-action@v1
473535
with:
474536
token: ${{ secrets.IKEMEN_TOKEN }}
475537
allowUpdates: true
476538
artifactErrorsFailBuild: true
477-
artifacts: "${{ steps.artifacts.outputs.artifact }}${{ matrix.cfg.runner_os == 'linux' && format(',{0}', steps.artifacts_ffmpeg.outputs.artifact_ffsrc) || '' }}"
539+
artifacts: "release-assets/*"
478540
# body: |
479541
# ${{ needs.tag.outputs.changelog }}
480542
discussionCategory: ${{ github.event.inputs.discussionCategory }}

0 commit comments

Comments
 (0)