diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index f5eaeb9..49ba852 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:
@@ -233,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."
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