Skip to content

Commit f9a4f9b

Browse files
authored
Merge pull request #253 from TriliumNext/feature/update_ci
CI improvements
2 parents 9647738 + 5277c3e commit f9a4f9b

File tree

6 files changed

+42
-13
lines changed

6 files changed

+42
-13
lines changed

.github/workflows/build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
on:
2+
workflow_call:
3+

.github/workflows/dev.yml

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
branches:
55
- '!develop'
66
- '!feature/update*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
712
jobs:
813
build_docker:
914
name: Build Docker image

.github/workflows/main.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ on:
44
branches:
55
- 'develop'
66
- 'feature/update*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
712
env:
813
REGISTRY: ghcr.io
914
IMAGE_NAME: ${{ github.repository }}
15+
1016
jobs:
1117
build_darwin-x64:
1218
name: Build macOS x86_64
@@ -19,7 +25,9 @@ jobs:
1925
node-version: 20
2026
cache: "npm"
2127
- run: npm ci
22-
- run: ./bin/build-mac-x64.sh
28+
- run: |
29+
./bin/update-build-info.sh
30+
./bin/build-mac-x64.sh
2331
- uses: actions/upload-artifact@v4
2432
with:
2533
name: trilium-mac-x64.zip
@@ -35,7 +43,9 @@ jobs:
3543
node-version: 20
3644
cache: "npm"
3745
- run: npm ci
38-
- run: ./bin/build-mac-arm64.sh
46+
- run: |
47+
./bin/update-build-info.sh
48+
./bin/build-mac-arm64.sh
3949
- uses: actions/upload-artifact@v4
4050
with:
4151
name: trilium-mac-arm64.zip
@@ -51,7 +61,9 @@ jobs:
5161
node-version: 20
5262
cache: "npm"
5363
- run: npm ci
54-
- run: ./bin/build-linux-x64.sh
64+
- run: |
65+
./bin/update-build-info.sh
66+
./bin/build-linux-x64.sh
5567
- uses: actions/upload-artifact@v4
5668
with:
5769
name: trilium-linux-x64.tar.xz
@@ -71,7 +83,9 @@ jobs:
7183
node-version: 20
7284
cache: "npm"
7385
- run: npm ci
74-
- run: ./bin/build-server.sh
86+
- run: |
87+
./bin/update-build-info.sh
88+
./bin/build-server.sh
7589
- uses: actions/upload-artifact@v4
7690
with:
7791
name: trilium-linux-x64-server.tar.xz
@@ -94,11 +108,13 @@ jobs:
94108
node-version: 20
95109
cache: "npm"
96110
- run: npm ci
97-
- run: ./bin/build-win-x64.sh
111+
- run: |
112+
./bin/update-build-info.sh
113+
./bin/build-win-x64.sh DONTPACK
98114
- uses: actions/upload-artifact@v4
99115
with:
100-
name: trilium-windows-x64.zip
101-
path: dist/trilium-windows-x64-*.zip
116+
name: trilium-windows-x64
117+
path: dist/trilium-windows-x64
102118
build_docker:
103119
name: Build Docker image
104120
runs-on: ubuntu-latest

bin/build-win-x64.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ rm -rf $BUILD_DIR/dump-db/node_modules
3434

3535
cp bin/tpl/trilium-{portable,no-cert-check,safe-mode}.bat $BUILD_DIR/
3636

37-
echo "Zipping windows x64 electron distribution..."
38-
VERSION=`jq -r ".version" package.json`
39-
40-
cd dist
37+
if [ "$1" != "DONTPACK" ]
38+
then
39+
echo "Zipping windows x64 electron distribution..."
40+
VERSION=`jq -r ".version" package.json`
4141

42-
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
42+
cd dist
43+
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
44+
fi

bin/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mv package.json.tmp package.json
3232

3333
git add package.json
3434

35-
echo 'export = { buildDate:"'`date --iso-8601=seconds`'", buildRevision: "'`git log -1 --format="%H"`'" };' > src/services/build.ts
35+
./update-build-info.sh
3636

3737
git add src/services/build.ts
3838

bin/update-build-info.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
echo 'export = { buildDate:"'`date --iso-8601=seconds`'", buildRevision: "'`git log -1 --format="%H"`'" };' > src/services/build.ts

0 commit comments

Comments
 (0)