Add Forgejo release workflow
Some checks failed
Release / Build Linux Release (push) Has been cancelled
Some checks failed
Release / Build Linux Release (push) Has been cancelled
This commit is contained in:
parent
46aee2d313
commit
6104851b8e
3 changed files with 64 additions and 3 deletions
61
.forgejo/workflows/release.yml
Normal file
61
.forgejo/workflows/release.yml
Normal 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
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "nextcloud-notes-desktop",
|
"name": "nextcloud-notes-desktop",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "nextcloud-notes-desktop",
|
"name": "nextcloud-notes-desktop",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^19.2.6",
|
"react": "^19.2.6",
|
||||||
"react-dom": "^19.2.6",
|
"react-dom": "^19.2.6",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "nextcloud-notes-desktop",
|
"name": "nextcloud-notes-desktop",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Fast cross-platform desktop client for Nextcloud Notes",
|
"description": "Fast cross-platform desktop client for Nextcloud Notes",
|
||||||
"author": {
|
"author": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue