Retire GitHub workflow after successful Gitea release
This commit is contained in:
@@ -1,101 +0,0 @@
|
|||||||
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:Version=${{ steps.version.outputs.version }} `
|
|
||||||
-o publish
|
|
||||||
|
|
||||||
- name: Build installer
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
Copy-Item -Recurse windows/Assets publish/Assets
|
|
||||||
& "C:\Program Files (x86)\Inno Setup 6\iscc.exe" /DAppVersion="${{ steps.version.outputs.version }}" windows\installer.iss
|
|
||||||
|
|
||||||
- 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-Installer.exe \
|
|
||||||
--title "$GITHUB_REF_NAME" \
|
|
||||||
--prerelease \
|
|
||||||
--notes "$notes"
|
|
||||||
|
|
||||||
- name: Update version-windows-beta.json on main
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
notes=$(cat windows/RELEASE_NOTES.md 2>/dev/null || echo "Windows beta ${{ steps.version.outputs.version }}")
|
|
||||||
content=$(jq -n \
|
|
||||||
--arg version "${{ steps.version.outputs.version }}" \
|
|
||||||
--arg url "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/ClaudeChecker-Installer.exe" \
|
|
||||||
--arg notes "$notes" \
|
|
||||||
'{version: $version, url: $url, notes: $notes}' | base64 -w0)
|
|
||||||
sha=$(gh api "repos/${{ github.repository }}/contents/version-windows-beta.json?ref=main" --jq .sha 2>/dev/null || echo "")
|
|
||||||
if [ -n "$sha" ]; then
|
|
||||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows-beta.json" \
|
|
||||||
--field "message=Windows beta release ${{ github.ref_name }}" \
|
|
||||||
--field "content=$content" \
|
|
||||||
--field "branch=main" \
|
|
||||||
--field "sha=$sha"
|
|
||||||
else
|
|
||||||
gh api --method PUT "repos/${{ github.repository }}/contents/version-windows-beta.json" \
|
|
||||||
--field "message=Windows beta release ${{ github.ref_name }}" \
|
|
||||||
--field "content=$content" \
|
|
||||||
--field "branch=main"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Update Windows beta badge in README on main
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
version="${{ steps.version.outputs.version }}"
|
|
||||||
tag="${{ github.ref_name }}"
|
|
||||||
shields_version=$(echo "$version" | sed 's/-/--/g')
|
|
||||||
export WIN_BADGE="[](https://github.com/${{ github.repository }}/releases/tag/${tag}) <!-- WIN_BETA_BADGE -->"
|
|
||||||
sha=$(gh api "repos/${{ github.repository }}/contents/README.md?ref=main" --jq .sha)
|
|
||||||
content=$(gh api "repos/${{ github.repository }}/contents/README.md?ref=main" --jq .content | python3 -c "
|
|
||||||
import sys, base64, os
|
|
||||||
raw = sys.stdin.read().strip()
|
|
||||||
text = base64.b64decode(raw).decode()
|
|
||||||
badge = os.environ['WIN_BADGE']
|
|
||||||
lines = text.splitlines(keepends=True)
|
|
||||||
out = [badge + chr(10) if '<!-- WIN_BETA_BADGE -->' in line else line for line in lines]
|
|
||||||
print(base64.b64encode(''.join(out).encode()).decode(), end='')
|
|
||||||
")
|
|
||||||
gh api --method PUT "repos/${{ github.repository }}/contents/README.md" \
|
|
||||||
--field "message=Windows beta badge $tag" \
|
|
||||||
--field "content=$content" \
|
|
||||||
--field "branch=main" \
|
|
||||||
--field "sha=$sha"
|
|
||||||
Reference in New Issue
Block a user