Skip to content

Commit 12d949a

Browse files
committed
WF
1 parent 5bec868 commit 12d949a

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,29 @@ jobs:
4444
set -euo pipefail
4545
git fetch --force --tags
4646
47-
SHOULD_PUBLISH="false"
47+
SHOULD_PUBLISH="true"
48+
PRERELEASE="false"
4849
4950
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
5051
TAG="$INPUT_TAG"
51-
SHOULD_PUBLISH="true"
5252
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
5353
git checkout --detach "refs/tags/${TAG}"
5454
else
5555
echo "::notice::Tag ${TAG} does not exist yet. Building current commit and creating tag via release."
5656
fi
5757
elif [ "$REF_TYPE" = "tag" ]; then
5858
TAG="$REF_NAME"
59-
SHOULD_PUBLISH="true"
6059
git checkout --detach "refs/tags/${TAG}"
6160
else
6261
TAG="snapshot-${HEAD_SHA::7}"
63-
echo "::notice::Branch push detected (${REF_NAME}); building snapshot artifacts with tag ${TAG}."
62+
PRERELEASE="true"
63+
echo "::notice::Branch push detected (${REF_NAME}); publishing prerelease ${TAG}."
6464
fi
6565
6666
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
6767
echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
6868
echo "should_publish=${SHOULD_PUBLISH}" >> "$GITHUB_OUTPUT"
69+
echo "prerelease=${PRERELEASE}" >> "$GITHUB_OUTPUT"
6970
7071
- name: Setup pnpm
7172
uses: pnpm/action-setup@v4
@@ -134,26 +135,15 @@ jobs:
134135
echo "compose=${COMPOSE_ASSET}" >> "$GITHUB_OUTPUT"
135136
136137
- name: Publish GitHub Release
137-
if: steps.ref.outputs.should_publish == 'true'
138138
uses: softprops/action-gh-release@v2
139139
with:
140140
tag_name: ${{ steps.ref.outputs.tag }}
141141
target_commitish: ${{ steps.ref.outputs.commit }}
142+
prerelease: ${{ steps.ref.outputs.prerelease == 'true' }}
142143
generate_release_notes: true
143144
fail_on_unmatched_files: true
144145
files: |
145146
${{ steps.pkg.outputs.archive }}
146147
${{ steps.pkg.outputs.sha }}
147148
${{ steps.pkg.outputs.egg }}
148149
${{ steps.pkg.outputs.compose }}
149-
150-
- name: Upload snapshot artifacts
151-
if: steps.ref.outputs.should_publish != 'true'
152-
uses: actions/upload-artifact@v4
153-
with:
154-
name: nitrocraft-${{ steps.ref.outputs.tag }}-node-server
155-
path: |
156-
${{ steps.pkg.outputs.archive }}
157-
${{ steps.pkg.outputs.sha }}
158-
${{ steps.pkg.outputs.egg }}
159-
${{ steps.pkg.outputs.compose }}

0 commit comments

Comments
 (0)