ci: build linux + windows zips and publish to Gitea release on tag
Some checks failed
/ Build App (push) Failing after 39s
Some checks failed
/ Build App (push) Failing after 39s
This commit is contained in:
parent
c8f8212d7a
commit
a47440a3ef
1 changed files with 35 additions and 2 deletions
37
.github/workflows/build.yml
vendored
37
.github/workflows/build.yml
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue