From 04059ac9986bbbcd216b616eaf9269672436a679 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:34:00 -0500 Subject: [PATCH] Add auto-release workflow on dev-to-main merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatically creates a GitHub release when dev is merged to main, reading the version from the App csproj. The existing build workflow then triggers and attaches per-platform zips. Flow: bump version on dev → merge dev to main → release + zips auto-created Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a9e7f61 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +on: + pull_request: + branches: [main] + types: [closed] + +permissions: + contents: write + +jobs: + create-release: + if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'dev' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Get version + id: version + shell: pwsh + run: | + $version = ([xml](Get-Content src/PlanViewer.App/PlanViewer.App.csproj)).Project.PropertyGroup.Version | Where-Object { $_ } + echo "VERSION=$version" >> $env:GITHUB_OUTPUT + + - name: Check if release already exists + id: check + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if gh release view "v${{ steps.version.outputs.VERSION }}" > /dev/null 2>&1; then + echo "EXISTS=true" >> $GITHUB_OUTPUT + else + echo "EXISTS=false" >> $GITHUB_OUTPUT + fi + + - name: Create release + if: steps.check.outputs.EXISTS == 'false' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "v${{ steps.version.outputs.VERSION }}" \ + --title "v${{ steps.version.outputs.VERSION }}" \ + --generate-notes \ + --target main