diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 69d144b..75e5d4e 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -12,7 +12,9 @@ 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 env: DOTNET_VERSION: 9.0 diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index af81f92..dcafbee 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -11,7 +11,9 @@ 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 steps: @@ -29,8 +31,8 @@ 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 @@ -49,7 +51,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/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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c1b814..404e28e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,8 +41,8 @@ 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 @@ -69,6 +69,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 +115,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 +251,7 @@ jobs: uses: actions/download-artifact@v4 with: name: publish - path: publish + path: ./build_artifacts # Install Inno Setup via Chocolatey - name: Install Inno Setup