ci: build linux + windows zips and publish to Gitea release on tag
Some checks failed
/ Build App (push) Failing after 39s

This commit is contained in:
MiTHRAL 2026-04-22 17:58:44 -04:00
parent c8f8212d7a
commit a47440a3ef

View file

@ -2,8 +2,13 @@ on:
push: push:
branches: branches:
- main - main
tags:
- 'v*'
pull_request: pull_request:
permissions:
contents: write
jobs: jobs:
build: build:
name: Build App name: Build App
@ -22,5 +27,33 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install run: pnpm install
- name: Build - name: Build Linux
run: pnpm run package run: pnpm exec electron-forge make --platform linux --arch x64 --targets @electron-forge/maker-zip
- name: Build Windows
run: pnpm exec electron-forge make --platform win32 --arch x64 --targets @electron-forge/maker-zip
- name: Create release and upload artifacts
if: startsWith(github.ref, 'refs/tags/v')
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
RESPONSE=$(curl -sf -X POST \
"https://git.mithraic.cloud/api/v1/repos/ad3laid3/sanctum/releases" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"Sanctum $TAG\",\"draft\":false,\"prerelease\":false}")
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
echo "Created release ID: $RELEASE_ID"
find out/make -type f -name "*.zip" | while read FILE; do
NAME=$(basename "$FILE")
echo "Uploading $NAME..."
curl -sf -X POST \
"https://git.mithraic.cloud/api/v1/repos/ad3laid3/sanctum/releases/$RELEASE_ID/assets?name=$NAME" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FILE"
done