Files
alfred-tmux-cheat-sheet/.gitea/workflows/build.yml
Felix Förtsch 5fa079664f
Some checks failed
Build Workflow / build (push) Failing after 5s
replace github-specific release action with gitea api calls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:12:51 +01:00

48 lines
1.6 KiB
YAML

name: Build Workflow
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: bash tests/test_tmux_search.sh
- name: Build .alfredworkflow
run: bash build/build_workflow.sh
- name: Extract version
id: version
run: |
VERSION=$(grep -A1 '<key>version</key>' info.plist | grep '<string>' | sed 's/.*<string>//;s/<\/string>.*//')
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Create release and upload artifact
env:
VERSION: v${{ steps.version.outputs.version }}
run: |
API="${GITHUB_SERVER_URL}/api/v1"
REPO="${GITHUB_REPOSITORY}"
AUTH="Authorization: token ${GITHUB_TOKEN}"
# delete existing release for this tag (idempotent)
EXISTING=$(curl -sf -H "$AUTH" "$API/repos/$REPO/releases/tags/$VERSION" | jq -r '.id // empty') || true
if [ -n "$EXISTING" ]; then
curl -sf -X DELETE -H "$AUTH" "$API/repos/$REPO/releases/$EXISTING"
fi
# create release
RELEASE_ID=$(curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$VERSION\",\"name\":\"$VERSION\",\"body\":\"Automated build from main\"}" \
"$API/repos/$REPO/releases" | jq -r '.id')
# upload artifact
curl -sf -X POST -H "$AUTH" \
-F "attachment=@dist/tmux-cheat-sheet.alfredworkflow" \
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=tmux-cheat-sheet.alfredworkflow"