From bdff778e9c4af40df2606ed9308d5bd11b318434 Mon Sep 17 00:00:00 2001 From: AMPW-german Date: Wed, 1 Jul 2026 21:18:06 +0200 Subject: [PATCH 1/2] Fix pipeline --- .github/workflows/dotnet.yml | 43 +++++++++++++++++++----------- GEffectsLogic/GEffectsLogic.csproj | 2 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f5eaeb9..075db23 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,6 +15,7 @@ jobs: versionprefix_changed: ${{ steps.versionprefix.outputs.changed }} version: ${{ steps.versionprefix.outputs.version }} artifact_name: ${{ steps.artifact-name.outputs.name }} + release_needed: ${{ steps.release-check.outputs.release_needed }} steps: - uses: actions/checkout@v4 @@ -46,6 +47,32 @@ jobs: echo "changed=false" >> "$GITHUB_OUTPUT" fi + - name: Check if current version needs release + id: release-check + shell: bash + run: | + if [ "$GITHUB_EVENT_NAME" != "push" ] || [ "$GITHUB_REF" != "refs/heads/main" ]; then + echo "release_needed=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + + new_version="${{ steps.versionprefix.outputs.version }}" + release_response=$(curl -sS -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2026-03-10" \ + "https://api.github.com/repos/${{ github.repository }}/releases/latest") + + current_version=$(echo "$release_response" | jq -r '.tag_name // empty') + + if [ -z "$current_version" ]; then + echo "release_needed=true" >> "$GITHUB_OUTPUT" + elif [ "$new_version" != "$current_version" ]; then + echo "release_needed=true" >> "$GITHUB_OUTPUT" + else + echo "release_needed=false" >> "$GITHUB_OUTPUT" + fi + - name: Build all configurations run: | dotnet build GEffectsLogic/GEffectsLogic.csproj -c Release --no-restore @@ -119,22 +146,8 @@ jobs: release-artifacts: runs-on: ubuntu-slim needs: build-artifacts - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build-artifacts.outputs.versionprefix_changed == 'true' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build-artifacts.outputs.release_needed == 'true' }} steps: - - name: Verify version change - shell: bash - run: | - new_version="${{ needs.build-artifacts.outputs.version }}" - current_version=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | grep -oP '"tag_name": "\K(.*)(?=")') - - echo "csproj version: $new_version" - echo "latest release version: $current_version" - - if [ "$new_version" = "$current_version" ]; then - echo "VersionPrefix has not changed since the last release. Skipping release." - exit 1 - fi - - name: Download build artifact uses: actions/download-artifact@v4 with: diff --git a/GEffectsLogic/GEffectsLogic.csproj b/GEffectsLogic/GEffectsLogic.csproj index 5f26935..9099f04 100644 --- a/GEffectsLogic/GEffectsLogic.csproj +++ b/GEffectsLogic/GEffectsLogic.csproj @@ -9,7 +9,7 @@ Debug;Release;PerfDebug False - 0.3.2 + 0.3.3 $(VersionPrefix) 0.3.1.0 $(VersionPrefix).0 From 87be378625a52d78e281a75d6f40b7f5ca1def5a Mon Sep 17 00:00:00 2001 From: AMPW-german Date: Wed, 1 Jul 2026 21:18:32 +0200 Subject: [PATCH 2/2] Test rebase merge --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 075db23..49ba852 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -246,4 +246,4 @@ jobs: exit 1 fi - echo "Release created and asset uploaded successfully." \ No newline at end of file + echo "Release created and asset uploaded successfully."