From 6c58ff71745392d9b9af7e5fab01652ee38c2eee Mon Sep 17 00:00:00 2001 From: Shun Moriya <23472415+shun126@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:57:24 +0900 Subject: [PATCH] Add tag-triggered Windows release zip workflow --- .github/workflows/release_windows_zip.yml | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/release_windows_zip.yml diff --git a/.github/workflows/release_windows_zip.yml b/.github/workflows/release_windows_zip.yml new file mode 100644 index 0000000..644a49c --- /dev/null +++ b/.github/workflows/release_windows_zip.yml @@ -0,0 +1,56 @@ +name: release-windows-zip +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + build-windows-zip: + runs-on: windows-latest + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "The name of your tag is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + - name: Set up Cygwin + uses: egor-tensin/setup-cygwin@v3 + with: + platform: x64 + packages: bison flex python3 make clang + - name: Add Environment variables + run: | + echo "GNU_BISON_BIN=C:\tools\cygwin\bin\bison.exe" >> $env:GITHUB_ENV + echo "GNU_FLEX_BIN=C:\tools\cygwin\bin\flex.exe" >> $env:GITHUB_ENV + echo "PYTHON_BIN=C:\tools\cygwin\bin\python3.9.exe" >> $env:GITHUB_ENV + echo $env:GNU_BISON_BIN + echo $env:GNU_FLEX_BIN + echo $env:PYTHON_BIN + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "The ${{ github.repository }} repository has been cloned to the runner." + - name: Generate Mana version infomation + working-directory: ./compiler + run: ${{env.PYTHON_BIN}} Version.py + - name: Build Mana 64bit compiler + run: msbuild mana.sln /t:build /p:Configuration=Release /p:Platform=x64 + - name: Prepare release zip + shell: pwsh + run: | + $stage = Join-Path $env:RUNNER_TEMP "release-stage" + $win64 = Join-Path $stage "Win64" + New-Item -ItemType Directory -Force -Path $win64 | Out-Null + Copy-Item -Path "x64/Release/mana.exe" -Destination (Join-Path $win64 "Mana.exe") + Copy-Item -Path "runner" -Destination (Join-Path $stage "runner") -Recurse + Copy-Item -Path "LICENSE.md" -Destination (Join-Path $stage "LICENSE.md") + $zipPath = Join-Path $env:RUNNER_TEMP "Mana-Windows-Release.zip" + if (Test-Path $zipPath) { Remove-Item $zipPath } + Compress-Archive -Path (Join-Path $stage "*") -DestinationPath $zipPath + "ZIP_PATH=$zipPath" | Out-File -FilePath $env:GITHUB_ENV -Append + - name: Upload release asset + uses: softprops/action-gh-release@v1 + with: + files: ${{ env.ZIP_PATH }}