Add Forgejo release workflow
Some checks failed
Release / Build Linux Release (push) Has been cancelled

This commit is contained in:
Daniel 2026-05-15 16:37:13 +02:00
parent 46aee2d313
commit 6104851b8e
3 changed files with 64 additions and 3 deletions

View file

@ -0,0 +1,61 @@
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
linux-release:
name: Build Linux Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build Linux packages
run: npm run dist:linux -- --publish never
- name: Create Forgejo release
if: startsWith(github.ref, 'refs/tags/v')
env:
FORGEJO_TOKEN: ${{ github.token }}
FORGEJO_API: https://git.danvics.com/api/v1
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -eu
response=$(curl -sS -X POST "$FORGEJO_API/repos/$REPO/releases" \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"target_commitish\":\"main\",\"name\":\"$TAG\",\"body\":\"Automated Linux desktop build.\",\"draft\":false,\"prerelease\":false}")
release_id=$(node -e "const data = JSON.parse(process.argv[1]); if (!data.id) throw new Error(JSON.stringify(data)); console.log(data.id)" "$response")
echo "release_id=$release_id" >> "$GITHUB_ENV"
- name: Upload release assets
if: startsWith(github.ref, 'refs/tags/v')
env:
FORGEJO_TOKEN: ${{ github.token }}
FORGEJO_API: https://git.danvics.com/api/v1
REPO: ${{ github.repository }}
run: |
set -eu
for artifact in release/*.AppImage release/*.deb; do
[ -f "$artifact" ] || continue
name=$(basename "$artifact")
curl -sS -X POST "$FORGEJO_API/repos/$REPO/releases/$release_id/assets?name=$name" \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$artifact"
done

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "nextcloud-notes-desktop",
"version": "0.1.0",
"version": "0.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "nextcloud-notes-desktop",
"version": "0.1.0",
"version": "0.1.1",
"dependencies": {
"react": "^19.2.6",
"react-dom": "^19.2.6",

View file

@ -1,6 +1,6 @@
{
"name": "nextcloud-notes-desktop",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"description": "Fast cross-platform desktop client for Nextcloud Notes",
"author": {