Skip to content

Commit 4a0ac28

Browse files
committed
WF Tweaks
1 parent a459ecd commit 4a0ac28

5 files changed

Lines changed: 26 additions & 21 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build Release
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- main
58
tags:
69
- "v*.*.*"
710
workflow_dispatch:
@@ -35,20 +38,28 @@ jobs:
3538
set -euo pipefail
3639
git fetch --force --tags
3740
41+
SHOULD_PUBLISH="false"
42+
3843
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
3944
TAG="${{ inputs.tag }}"
45+
SHOULD_PUBLISH="true"
4046
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
4147
git checkout --detach "refs/tags/${TAG}"
4248
else
4349
echo "::notice::Tag ${TAG} does not exist yet. Building current commit and creating tag via release."
4450
fi
45-
else
51+
elif [ "${GITHUB_REF_TYPE}" = "tag" ]; then
4652
TAG="${GITHUB_REF_NAME}"
53+
SHOULD_PUBLISH="true"
4754
git checkout --detach "refs/tags/${TAG}"
55+
else
56+
TAG="snapshot-${GITHUB_SHA::7}"
57+
echo "::notice::Branch push detected (${GITHUB_REF_NAME}); building snapshot artifacts with tag ${TAG}."
4858
fi
4959
5060
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
5161
echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
62+
echo "should_publish=${SHOULD_PUBLISH}" >> "$GITHUB_OUTPUT"
5263
5364
- name: Setup pnpm
5465
uses: pnpm/action-setup@v4
@@ -95,6 +106,7 @@ jobs:
95106
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
96107
97108
- name: Publish GitHub Release
109+
if: steps.ref.outputs.should_publish == 'true'
98110
uses: softprops/action-gh-release@v2
99111
with:
100112
tag_name: ${{ steps.ref.outputs.tag }}
@@ -104,3 +116,12 @@ jobs:
104116
files: |
105117
${{ steps.pkg.outputs.archive }}
106118
${{ steps.pkg.outputs.sha }}
119+
120+
- name: Upload snapshot artifacts
121+
if: steps.ref.outputs.should_publish != 'true'
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: nitrocraft-${{ steps.ref.outputs.tag }}-node-server
125+
path: |
126+
${{ steps.pkg.outputs.archive }}
127+
${{ steps.pkg.outputs.sha }}

.github/workflows/docker-package.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ on:
77
- main
88
tags:
99
- "v*.*.*"
10-
paths:
11-
- Dockerfile
12-
- package.json
13-
- pnpm-lock.yaml
14-
- src/**
15-
- public/**
16-
- nitro.config.ts
17-
- .github/workflows/docker-package.yml
1810
workflow_dispatch:
1911

2012
permissions:
@@ -60,7 +52,6 @@ jobs:
6052
6153
echo "owner=$OWNER" >> "$GITHUB_OUTPUT"
6254
echo "image=$IMAGE" >> "$GITHUB_OUTPUT"
63-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
6455
echo "version_tag=v${VERSION}" >> "$GITHUB_OUTPUT"
6556
6657
- name: Set up QEMU
@@ -84,9 +75,6 @@ jobs:
8475
tags: |
8576
type=raw,value=latest,enable={{is_default_branch}}
8677
type=raw,value=${{ steps.vars.outputs.version_tag }}
87-
type=raw,value=${{ steps.vars.outputs.version }}
88-
type=ref,event=tag
89-
type=sha,format=short
9078
labels: |
9179
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
9280
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches:
66
- master
77
- main
8-
paths:
9-
- package.json
108
workflow_dispatch:
119

1210
permissions:
@@ -63,17 +61,15 @@ jobs:
6361
fi
6462
6563
echo "version_tag=v${VERSION}" >> "$GITHUB_OUTPUT"
66-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
6764
6865
- name: Generate image metadata
6966
id: meta
7067
uses: docker/metadata-action@v5
7168
with:
7269
images: docker.io/${{ secrets.DOCKERHUB_REPOSITORY }}
7370
tags: |
74-
type=raw,value=latest
71+
type=raw,value=latest,enable={{is_default_branch}}
7572
type=raw,value=${{ steps.version.outputs.version_tag }}
76-
type=raw,value=${{ steps.version.outputs.version }}
7773
7874
- name: Show tags to publish
7975
shell: bash

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 NitroCraft Team
3+
Copyright (c) 2026 NitroCraft Team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nitrocraft",
3-
"version": "1.0.9",
3+
"version": "1.1.0",
44
"private": false,
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)