c1213d913c
checkout@v4 inits a SHA-1 repository and then fetches, which a SHA-256
server refuses ("mismatched algorithms"). A plain git clone negotiates
the object format, so the workflows check out with git + the injected
token (branch for pushes/PRs, tag for releases).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
59 lines
2.1 KiB
YAML
59 lines
2.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
agent-artifacts:
|
|
# Publishes the self-contained agent, MSI and checksums, then attaches them
|
|
# to a Gitea release for the unified version.
|
|
# Label must match a registered runner: windows-host.
|
|
runs-on: windows-host
|
|
steps:
|
|
# SHA-256 repo: plain git clone (actions/checkout inits SHA-1 and
|
|
# cannot fetch from a SHA-256 server).
|
|
- name: Checkout
|
|
shell: pwsh
|
|
env:
|
|
CHECKOUT_TOKEN: ${{ github.token }}
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
Get-ChildItem -Force | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
|
$url = '${{ github.server_url }}/${{ github.repository }}.git' -replace '^https://', "https://x-access-token:$env:CHECKOUT_TOKEN@"
|
|
git clone --depth 1 --branch '${{ github.ref_name }}' $url .
|
|
git log -1 --format='%H %s'
|
|
|
|
- name: Setup .NET 10
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10.0.x'
|
|
|
|
- name: Compute unified version
|
|
id: ver
|
|
shell: pwsh
|
|
run: |
|
|
$v = & ./scripts/Get-UnifiedVersion.ps1
|
|
"version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
|
|
|
|
- name: Generate icon
|
|
shell: pwsh
|
|
run: ./scripts/Generate-Icons.ps1
|
|
|
|
- name: Package agent (exe zip + MSI + checksums)
|
|
shell: pwsh
|
|
run: ./scripts/Package-Agent.ps1 -Version ${{ steps.ver.outputs.version }}
|
|
|
|
- name: Create Gitea release and upload assets
|
|
shell: pwsh
|
|
env:
|
|
# GITEA_TOKEN is injected automatically by Gitea Actions; SERVER_URL
|
|
# is seeded by scripts/Initialize-GiteaSecrets.ps1 and falls back to
|
|
# the instance URL the runner already knows.
|
|
GITEA_URL: ${{ vars.SERVER_URL || github.server_url }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_OWNER: ${{ github.repository_owner }}
|
|
GITEA_REPOSITORY: ${{ github.event.repository.name }}
|
|
VERSION: ${{ steps.ver.outputs.version }}
|
|
run: ./scripts/Publish-Release.ps1 -Version $env:VERSION
|