Skip to content

Commit 580a02f

Browse files
committed
2 parents 7a0f5d5 + bb70978 commit 580a02f

File tree

9 files changed

+495
-64
lines changed

9 files changed

+495
-64
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* eslint-disable */
2+
3+
import { writeFileSync } from "fs";
4+
5+
// 命令行参数:
6+
// node ./generate-pkgbuild.mjs <pkgname> <pkgver> <sha256sums>
7+
const pkgname = process.argv[2];
8+
const pkgver = process.argv[3];
9+
const sha256sums = process.argv[4];
10+
11+
if (!pkgname || !pkgver || !sha256sums) {
12+
console.error("Usage: node generate-pkgbuild.mjs <pkgname> <pkgver> <sha256sums>");
13+
process.exit(1);
14+
}
15+
16+
const conflicts =
17+
pkgname === "project-graph-nightly-bin"
18+
? ["project-graph-bin", "project-graph-git"]
19+
: ["project-graph-nightly-bin", "project-graph-git"];
20+
const source =
21+
pkgname === "project-graph-nightly-bin"
22+
? `https://github.com/LiRenTech/project-graph/releases/download/nightly/Project.Graph_0.0.0-nightly.${pkgver}_amd64.deb`
23+
: `https://github.com/LiRenTech/project-graph/releases/download/v${pkgver}/Project.Graph_${pkgver}_amd64.deb`;
24+
25+
const PKGBUILD = `# Maintainer: zty012 <[email protected]>
26+
pkgname=${pkgname}
27+
pkgver=${pkgver}
28+
pkgrel=1
29+
pkgdesc="A simple tool to create topology diagrams."
30+
arch=('x86_64')
31+
url="https://github.com/LiRenTech/project-graph"
32+
license=('mit')
33+
depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk')
34+
options=('!strip' '!emptydirs')
35+
provides=('project-graph')
36+
conflicts=(${conflicts.map((x) => `'${x}'`).join(" ")})
37+
install=${pkgname}.install
38+
source_x86_64=('${source}')
39+
sha256sums_x86_64=('${sha256sums}')
40+
package() {
41+
# Extract package data
42+
tar -xz -f data.tar.gz -C "\${pkgdir}"
43+
}
44+
`;
45+
46+
console.log("===== PKGBUILD =====");
47+
console.log(PKGBUILD);
48+
writeFileSync("./PKGBUILD", PKGBUILD);
49+
50+
const SRCINFO = `pkgbase = project-graph-nightly-bin
51+
\tpkgdesc = A simple tool to create topology diagrams.
52+
\tpkgver = ${pkgver}
53+
\tpkgrel = 1
54+
\turl = https://github.com/LiRenTech/project-graph
55+
\tinstall = ${pkgname}.install
56+
\tarch = x86_64
57+
\tlicense = mit
58+
\tdepends = cairo
59+
\tdepends = desktop-file-utils
60+
\tdepends = gdk-pixbuf2
61+
\tdepends = glib2
62+
\tdepends = gtk3
63+
\tdepends = hicolor-icon-theme
64+
\tdepends = libsoup
65+
\tdepends = pango
66+
\tdepends = webkit2gtk
67+
\tprovides = project-graph
68+
${conflicts.map((x) => `\tconflicts = ${x}`).join("\n")}
69+
\toptions = !strip
70+
\toptions = !emptydirs
71+
\tsource_x86_64 = ${source}
72+
\tsha256sums_x86_64 = ${sha256sums}
73+
74+
pkgname = ${pkgname}`;
75+
76+
console.log("===== .SRCINFO =====");
77+
console.log(SRCINFO);
78+
writeFileSync("./.SRCINFO", SRCINFO);

.github/workflows/nightly.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,10 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
generate-changelog:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
changelog: ${{ steps.generate.outputs.changelog }}
14-
env:
15-
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
16-
steps:
17-
- uses: actions/checkout@v2
18-
with:
19-
fetch-depth: 0
20-
- name: Setup Node
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 20
24-
- name: Install dependencies
25-
run: npm i -g node-fetch
26-
- id: generate
27-
run: |
28-
changelog=$(node ./.github/scripts/generate-changelog.mjs)
29-
echo $changelog
30-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
31-
echo "${changelog}" >> $GITHUB_OUTPUT
32-
echo "EOF" >> $GITHUB_OUTPUT
33-
3410
build:
35-
needs: generate-changelog
3611
permissions:
3712
contents: write
38-
uses: LiRenTech/turbo-tauri/.github/workflows/turbo-tauri.yml@master
13+
uses: ./.github/workflows/publish.yml
3914
with:
4015
android_key_alias: "upload"
4116
android_key_path: "upload.jks"
@@ -48,7 +23,6 @@ jobs:
4823
delete_release: true
4924
prerelease: true
5025
release_name: "Nightly Build ${{ github.run_number }}"
51-
release_notes: ${{ needs.generate-changelog.outputs.changelog }}
5226
release_tag: "nightly"
5327
task_build: "tauri:build"
5428
task_build_android: "tauri:build:android"
@@ -63,3 +37,4 @@ jobs:
6337
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
6438
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
6539
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
40+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}

0 commit comments

Comments
 (0)