Skip to content

Commit

Permalink
Merge pull request #253 from TriliumNext/feature/update_ci
Browse files Browse the repository at this point in the history
CI improvements
  • Loading branch information
eliandoran authored Jul 20, 2024
2 parents 9647738 + 5277c3e commit f9a4f9b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
on:
workflow_call:

5 changes: 5 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
branches:
- '!develop'
- '!feature/update*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_docker:
name: Build Docker image
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ on:
branches:
- 'develop'
- 'feature/update*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build_darwin-x64:
name: Build macOS x86_64
Expand All @@ -19,7 +25,9 @@ jobs:
node-version: 20
cache: "npm"
- run: npm ci
- run: ./bin/build-mac-x64.sh
- run: |
./bin/update-build-info.sh
./bin/build-mac-x64.sh
- uses: actions/upload-artifact@v4
with:
name: trilium-mac-x64.zip
Expand All @@ -35,7 +43,9 @@ jobs:
node-version: 20
cache: "npm"
- run: npm ci
- run: ./bin/build-mac-arm64.sh
- run: |
./bin/update-build-info.sh
./bin/build-mac-arm64.sh
- uses: actions/upload-artifact@v4
with:
name: trilium-mac-arm64.zip
Expand All @@ -51,7 +61,9 @@ jobs:
node-version: 20
cache: "npm"
- run: npm ci
- run: ./bin/build-linux-x64.sh
- run: |
./bin/update-build-info.sh
./bin/build-linux-x64.sh
- uses: actions/upload-artifact@v4
with:
name: trilium-linux-x64.tar.xz
Expand All @@ -71,7 +83,9 @@ jobs:
node-version: 20
cache: "npm"
- run: npm ci
- run: ./bin/build-server.sh
- run: |
./bin/update-build-info.sh
./bin/build-server.sh
- uses: actions/upload-artifact@v4
with:
name: trilium-linux-x64-server.tar.xz
Expand All @@ -94,11 +108,13 @@ jobs:
node-version: 20
cache: "npm"
- run: npm ci
- run: ./bin/build-win-x64.sh
- run: |
./bin/update-build-info.sh
./bin/build-win-x64.sh DONTPACK
- uses: actions/upload-artifact@v4
with:
name: trilium-windows-x64.zip
path: dist/trilium-windows-x64-*.zip
name: trilium-windows-x64
path: dist/trilium-windows-x64
build_docker:
name: Build Docker image
runs-on: ubuntu-latest
Expand Down
12 changes: 7 additions & 5 deletions bin/build-win-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ rm -rf $BUILD_DIR/dump-db/node_modules

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

echo "Zipping windows x64 electron distribution..."
VERSION=`jq -r ".version" package.json`

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

zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
cd dist
zip -r9 trilium-windows-x64-${VERSION}.zip trilium-windows-x64
fi
2 changes: 1 addition & 1 deletion bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mv package.json.tmp package.json

git add package.json

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

git add src/services/build.ts

Expand Down
3 changes: 3 additions & 0 deletions bin/update-build-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

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

0 comments on commit f9a4f9b

Please sign in to comment.