Files
nextcloud-workflow-deck-aut…/.gitea/workflows/build-main.yml
T
Patrick Niebeling c5bf6f8f0d
Build main artifact / package (push) Successful in 1m2s
Lint info.xml / xml-lint (push) Successful in 15s
Lint PHP / php-lint (8.2) (push) Successful in 46s
Lint PHP / php-lint (8.3) (push) Successful in 45s
Lint PHP / php-lint (8.4) (push) Successful in 37s
PHPUnit / unit-tests (push) Successful in 42s
Add rolling main-branch build workflow for manual server deploys
Publishes the appstore package as a Gitea release asset on every push
to main, so a deployable build can be grabbed without cutting a
version tag first.
2026-08-13 12:52:29 +02:00

58 lines
2.2 KiB
YAML

name: Build main artifact
on:
push:
branches:
- main
jobs:
package:
runs-on: gitea-runner-server03
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
- name: Install JS dependencies
run: npm install
- name: Build frontend
run: npm run build
- name: Package appstore artifact
run: make appstore
- name: Publish rolling "latest-main" release
env:
GITEA_API: ${{ gitea.server_url }}/api/v1
REPO: ${{ gitea.repository }}
TOKEN: ${{ secrets.RELEASE_TOKEN }}
SHA: ${{ gitea.sha }}
run: |
set -e
TAG="latest-main"
ASSET="build/artifacts/appstore/workflow_deck_automation.tar.gz"
# Drop any previous release+tag so the download URL always serves the newest build
curl -s -H "Authorization: token $TOKEN" \
"$GITEA_API/repos/$REPO/releases/tags/$TAG" -o /tmp/old_release.json
OLD_ID=$(node -e "try{const j=require('/tmp/old_release.json');console.log(j.id||'')}catch(e){console.log('')}")
if [ -n "$OLD_ID" ]; then
curl -s -X DELETE -H "Authorization: token $TOKEN" \
"$GITEA_API/repos/$REPO/releases/$OLD_ID"
fi
curl -s -X DELETE -H "Authorization: token $TOKEN" \
"$GITEA_API/repos/$REPO/tags/$TAG" > /dev/null || true
# Re-create the tag+release pointing at the commit that was just built
curl -s -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"target_commitish\":\"$SHA\",\"name\":\"Latest main build\",\"body\":\"Automatisch aus $SHA gebaut - nur zum schnellen Testen/Deployen, kein offizielles Release.\",\"prerelease\":true}" \
"$GITEA_API/repos/$REPO/releases" -o /tmp/new_release.json
NEW_ID=$(node -e "console.log(require('/tmp/new_release.json').id)")
curl -s -X POST -H "Authorization: token $TOKEN" \
-F "attachment=@$ASSET" \
"$GITEA_API/repos/$REPO/releases/$NEW_ID/assets?name=workflow_deck_automation.tar.gz"