refactor(ci): use actions/checkout for public repo release flow
Some checks failed
CI / build (push) Failing after 0s
Some checks failed
CI / build (push) Failing after 0s
Drops the manual mktemp + git-clone-with-token dance (not needed for a public repo) in favor of actions/checkout@v4. GITEA_TOKEN is still required for the release-creation and asset-upload API calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,11 @@ jobs:
|
|||||||
GITEA_API: https://git.kuns.dev/api/v1
|
GITEA_API: https://git.kuns.dev/api/v1
|
||||||
REPO: releases/ClaudeMailbox
|
REPO: releases/ClaudeMailbox
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout tag
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Resolve version
|
- name: Resolve version
|
||||||
id: ver
|
id: ver
|
||||||
run: |
|
run: |
|
||||||
@@ -23,34 +28,12 @@ jobs:
|
|||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
echo "Building version: $VERSION (tag: $TAG)"
|
echo "Building version: $VERSION (tag: $TAG)"
|
||||||
|
|
||||||
- name: Prepare workspace
|
|
||||||
id: ws
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
WORK="$(mktemp -d -t claude-mailbox-release-XXXXXX)"
|
|
||||||
echo "dir=$WORK" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "Workspace: $WORK"
|
|
||||||
|
|
||||||
- name: Checkout tag
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
WORK: ${{ steps.ws.outputs.dir }}
|
|
||||||
TAG: ${{ steps.ver.outputs.tag }}
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
git clone --branch "$TAG" \
|
|
||||||
"https://oauth2:${TOKEN}@git.kuns.dev/${REPO}.git" \
|
|
||||||
"$WORK/src"
|
|
||||||
git -C "$WORK/src" log -1 --oneline
|
|
||||||
|
|
||||||
- name: Publish (win-x64, self-contained, single-file)
|
- name: Publish (win-x64, self-contained, single-file)
|
||||||
env:
|
env:
|
||||||
WORK: ${{ steps.ws.outputs.dir }}
|
|
||||||
VERSION: ${{ steps.ver.outputs.version }}
|
VERSION: ${{ steps.ver.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export PATH="$DOTNET_ROOT:$PATH"
|
export PATH="$DOTNET_ROOT:$PATH"
|
||||||
cd "$WORK/src"
|
|
||||||
dotnet publish src/ClaudeMailbox/ClaudeMailbox.csproj \
|
dotnet publish src/ClaudeMailbox/ClaudeMailbox.csproj \
|
||||||
-c Release -r win-x64 --self-contained true \
|
-c Release -r win-x64 --self-contained true \
|
||||||
/p:MinVerVersionOverride=$VERSION \
|
/p:MinVerVersionOverride=$VERSION \
|
||||||
@@ -60,11 +43,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Package assets
|
- name: Package assets
|
||||||
env:
|
env:
|
||||||
WORK: ${{ steps.ws.outputs.dir }}
|
|
||||||
VERSION: ${{ steps.ver.outputs.version }}
|
VERSION: ${{ steps.ver.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$WORK/src"
|
|
||||||
mkdir -p assets
|
mkdir -p assets
|
||||||
|
|
||||||
EXE_SRC=$(ls out/app/*.exe | head -n 1)
|
EXE_SRC=$(ls out/app/*.exe | head -n 1)
|
||||||
@@ -108,13 +89,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload release assets
|
- name: Upload release assets
|
||||||
env:
|
env:
|
||||||
WORK: ${{ steps.ws.outputs.dir }}
|
|
||||||
VERSION: ${{ steps.ver.outputs.version }}
|
VERSION: ${{ steps.ver.outputs.version }}
|
||||||
RELEASE_ID: ${{ steps.release.outputs.release_id }}
|
RELEASE_ID: ${{ steps.release.outputs.release_id }}
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$WORK/src/assets"
|
cd assets
|
||||||
for f in \
|
for f in \
|
||||||
"claude-mailbox-${VERSION}-win-x64.exe" \
|
"claude-mailbox-${VERSION}-win-x64.exe" \
|
||||||
"checksums.txt"
|
"checksums.txt"
|
||||||
@@ -127,10 +107,3 @@ jobs:
|
|||||||
> /dev/null
|
> /dev/null
|
||||||
done
|
done
|
||||||
echo "All assets uploaded."
|
echo "All assets uploaded."
|
||||||
|
|
||||||
- name: Cleanup workspace
|
|
||||||
if: always()
|
|
||||||
env:
|
|
||||||
WORK: ${{ steps.ws.outputs.dir }}
|
|
||||||
run: |
|
|
||||||
rm -rf "$WORK" || true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user