From b430caa22ad585fff1a883563347ee71917a923c Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:37:06 +0100 Subject: [PATCH 1/3] Fix PR logic and release flow * Only run internal PR actions on internal PR's * Fix release flow --- .github/workflows/pr-build.yml | 2 ++ .github/workflows/pr-version.yml | 10 +++++----- .github/workflows/release.yml | 27 +++++++++++++-------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 69d144b..21bb862 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -13,6 +13,8 @@ permissions: jobs: preview: + # Only run for local PRs + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest env: DOTNET_VERSION: 9.0 diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index af81f92..f49927c 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -12,6 +12,8 @@ permissions: jobs: preview: + # Only run for local PRs + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: @@ -29,12 +31,10 @@ jobs: git fetch --tags || true current=$(git describe --tags --abbrev=0 2>/dev/null || true) if [ -z "$current" ]; then - echo "No tags found, defaulting to v0.0.0" - current="v0.0.0" + echo "No tags found, defaulting to 0.0.0" + current="0.0.0" fi - # Remove leading 'v' then extract parts using awk - ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') @@ -49,7 +49,7 @@ jobs: patch=$((patch+1)); type="patch" fi - next="v${major}.${minor}.${patch}" + next="${major}.${minor}.${patch}" # Safely write outputs if [ -n "$GITHUB_OUTPUT" ]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c1b814..2055c43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,12 +41,10 @@ jobs: git fetch --tags || true current=$(git describe --tags --abbrev=0 2>/dev/null || true) if [ -z "$current" ]; then - echo "No tags found, defaulting to v0.0.0" - current="v0.0.0" + echo "No tags found, defaulting to 0.0.0" + current="0.0.0" fi - # Remove leading 'v' then extract parts using awk - ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') @@ -69,6 +67,15 @@ jobs: echo "prev_version=$current" >> $GITHUB_OUTPUT echo "new_version=$new_version" >> $GITHUB_OUTPUT + - name: Tag and push new version + run: | + git config user.name "github-actions" + git config user.email "actions@github.com" + + NEW_VERSION="${{ steps.version.outputs.new_version }}" + git tag "$NEW_VERSION" + git push origin "$NEW_VERSION" + - name: Setup NuGet source run: | dotnet nuget add source \ @@ -106,18 +113,10 @@ jobs: mv ${{ env.LAUNCHER_OUTPUT_PATH }}/StarMap.Launcher.exe ${{ env.LAUNCHER_OUTPUT_PATH }}/StarMap.exe mv ${{ env.STANDALONE_OUTPUT_PATH }}/StarMap.Loader.exe ${{ env.STANDALONE_OUTPUT_PATH }}/StarMap.exe - - name: Tag and push new version - run: | - git config user.name "github-actions" - git config user.email "actions@github.com" - - NEW_VERSION="${{ steps.version.outputs.new_version }}" - git tag "$NEW_VERSION" - git push origin "$NEW_VERSION" - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: rc-build + name: publish path: | ${{ env.LAUNCHER_OUTPUT_PATH }} ${{ env.STANDALONE_OUTPUT_PATH }} @@ -250,7 +249,7 @@ jobs: uses: actions/download-artifact@v4 with: name: publish - path: publish + path: ./build_artifacts # Install Inno Setup via Chocolatey - name: Install Inno Setup From 637b39277cfa99d3480ff70ff58608deed74496f Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Mon, 23 Feb 2026 20:41:57 +0100 Subject: [PATCH 2/3] Fix version determine logic --- .github/workflows/pr-version.yml | 2 ++ .github/workflows/release.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index f49927c..e5af5e5 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -35,6 +35,8 @@ jobs: current="0.0.0" fi + # Remove leading 'v' then extract parts using awk + ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2055c43..404e28e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,8 @@ jobs: current="0.0.0" fi + # Remove leading 'v' then extract parts using awk + ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') From a00a1026d70c1bcf49b66048edd4a7d92b9cea67 Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Mon, 23 Feb 2026 20:45:18 +0100 Subject: [PATCH 3/3] Rename actions and steps --- .github/workflows/pr-build.yml | 2 +- .github/workflows/pr-version.yml | 2 +- .github/workflows/rc-build.yml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 21bb862..75e5d4e 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -12,7 +12,7 @@ permissions: packages: read jobs: - preview: + build: # Only run for local PRs if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index e5af5e5..dcafbee 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -11,7 +11,7 @@ permissions: contents: read jobs: - preview: + preview-version: # Only run for local PRs if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/.github/workflows/rc-build.yml b/.github/workflows/rc-build.yml index b15d176..7498361 100644 --- a/.github/workflows/rc-build.yml +++ b/.github/workflows/rc-build.yml @@ -1,4 +1,4 @@ -name: Release new version +name: Release new RC release on: push: @@ -62,6 +62,11 @@ jobs: echo "new_version=$new_version" >> $GITHUB_OUTPUT echo "hash_version=$hash_version" >> $GITHUB_OUTPUT + - name: Update RC tag + run: | + git tag -f rc + git push origin rc --force + - name: Setup NuGet source run: | dotnet nuget add source \ @@ -195,8 +200,3 @@ jobs: ./build_artifacts/version.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update RC tag - run: | - git tag -f rc - git push origin rc --force