72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
name: Release Windows Beta
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'win-v*-beta*'
|
|
|
|
jobs:
|
|
release-windows-beta:
|
|
runs-on: windows-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Get version from tag
|
|
id: version
|
|
shell: bash
|
|
run: echo "version=${GITHUB_REF_NAME#win-v}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Publish
|
|
run: |
|
|
dotnet publish windows/ClaudeCheckerWindows.csproj `
|
|
-c Release -r win-x64 `
|
|
--self-contained true `
|
|
-p:PublishSingleFile=true `
|
|
-p:Version=${{ steps.version.outputs.version }} `
|
|
-o publish
|
|
|
|
- name: Zip
|
|
shell: pwsh
|
|
run: |
|
|
Copy-Item -Recurse windows/Assets publish/Assets
|
|
Compress-Archive -Path publish/* -DestinationPath ClaudeChecker-Windows.zip
|
|
|
|
- name: Create GitHub pre-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
shell: bash
|
|
run: |
|
|
notes=$(cat windows/RELEASE_NOTES.md 2>/dev/null || echo "Windows beta ${{ steps.version.outputs.version }}")
|
|
gh release create "$GITHUB_REF_NAME" ClaudeChecker-Windows.zip \
|
|
--title "$GITHUB_REF_NAME" \
|
|
--prerelease \
|
|
--notes "$notes"
|
|
|
|
- name: Update version-windows-beta.json on main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
shell: bash
|
|
run: |
|
|
notes=$(cat windows/RELEASE_NOTES.md 2>/dev/null || echo "Windows beta ${{ steps.version.outputs.version }}")
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git fetch origin main
|
|
git checkout main
|
|
jq -n \
|
|
--arg version "${{ steps.version.outputs.version }}" \
|
|
--arg url "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/ClaudeChecker-Windows.zip" \
|
|
--arg notes "$notes" \
|
|
'{version: $version, url: $url, notes: $notes}' > version-windows-beta.json
|
|
git add version-windows-beta.json
|
|
git commit -m "Windows beta release ${{ github.ref_name }}"
|
|
git push origin main
|