Skip to content

Commit 9797ed0

Browse files
committed
update ci
1 parent 1a4e33f commit 9797ed0

File tree

2 files changed

+88
-59
lines changed

2 files changed

+88
-59
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
push:
1212
branches:
1313
- main
14+
paths-ignore:
15+
- '**.md'
16+
- '.gitignore'
17+
- '.editorconfig'
18+
- 'LICENSE'
19+
- '.github/ISSUE_TEMPLATE/**'
1420
workflow_dispatch:
1521

1622
jobs:
@@ -22,22 +28,41 @@ jobs:
2228

2329
runs-on: ${{ matrix.platform }}
2430

31+
env:
32+
PNPM_VERSION: 8.x.x
33+
NODE_VERSION: 18
34+
RUST_TOOLCHAIN: stable
35+
2536
steps:
2637
- name: Checkout repository
27-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
2839
with:
29-
fetch-depth: 0
40+
fetch-depth: 1
3041
submodules: recursive
3142

32-
- uses: pnpm/action-setup@v4
43+
- name: Install pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: ${{ env.PNPM_VERSION }}
47+
run_install: false
48+
49+
- name: Setup Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: ${{ env.NODE_VERSION }}
53+
cache: pnpm
54+
55+
- name: Install Rust
56+
uses: dtolnay/rust-toolchain@stable
3357
with:
34-
version: latest
58+
toolchain: ${{ env.RUST_TOOLCHAIN }}
3559

36-
- name: install dependencies (ubuntu only)
60+
- name: Install system dependencies (Ubuntu)
3761
if: matrix.platform == 'ubuntu-22.04'
3862
run: |
39-
sudo apt update
40-
sudo apt install libwebkit2gtk-4.1-dev \
63+
sudo apt-get update
64+
sudo apt-get install -y --no-install-recommends \
65+
libwebkit2gtk-4.1-dev \
4166
build-essential \
4267
curl \
4368
wget \
@@ -47,41 +72,28 @@ jobs:
4772
libayatana-appindicator3-dev \
4873
librsvg2-dev
4974
50-
- name: Update macos-latest
51-
if: matrix.platform == 'macos-latest'
52-
run: |
53-
brew install rocksdb
54-
brew install llvm
55-
56-
- name: install dependencies (mac only)
75+
- name: Install system dependencies (macOS)
5776
if: matrix.platform == 'macos-latest'
5877
run: |
78+
brew install rocksdb llvm
5979
rustup target add aarch64-apple-darwin
6080
61-
- name: Install Rust stable
62-
uses: dtolnay/rust-toolchain@stable
63-
64-
- name: Rust cache
81+
- name: Cache Rust dependencies
6582
uses: swatinem/rust-cache@v2
6683
with:
6784
workspaces: "./src-tauri -> target"
85+
cache-on-failure: true
86+
shared-key: "${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}"
6887

69-
- name: Sync node version and setup cache
70-
uses: actions/setup-node@v3
71-
with:
72-
node-version: "18"
73-
cache: "pnpm"
74-
75-
- name: Install app dependencies and build web
76-
run: pnpm install --frozen-lockfile
77-
78-
- name: submodules install
79-
run: cd it-tools && pnpm install
88+
- name: Install dependencies
89+
run: |
90+
pnpm install --frozen-lockfile
91+
cd it-tools && pnpm install --frozen-lockfile
8092
8193
- name: Build the app
8294
uses: tauri-apps/tauri-action@v0
8395
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8597
with:
8698
tagName: ${{ github.ref_name }}
8799
releaseName: it-tools-app ${{ needs.create-release.outputs.APP_VERSION }}

.github/workflows/release.yml

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ on:
1212
jobs:
1313
create-release:
1414
runs-on: ubuntu-latest
15+
outputs:
16+
release_tag: ${{ steps.vars.outputs.tag }}
1517
steps:
16-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1719
with:
1820
fetch-depth: 0
1921
submodules: recursive
@@ -23,9 +25,9 @@ jobs:
2325
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
2426

2527
- name: Setup node
26-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
2729
with:
28-
node-version: 16.x
30+
node-version: 18
2931

3032
- name: Generate changelog
3133
id: create_release
@@ -42,18 +44,41 @@ jobs:
4244

4345
runs-on: ${{ matrix.platform }}
4446

47+
env:
48+
PNPM_VERSION: 8.x.x
49+
NODE_VERSION: 18
50+
RUST_TOOLCHAIN: stable
51+
4552
steps:
4653
- name: Checkout repository
47-
uses: actions/checkout@v3
48-
- uses: pnpm/action-setup@v2
54+
uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 1
57+
submodules: recursive
58+
59+
- name: Install pnpm
60+
uses: pnpm/action-setup@v4
61+
with:
62+
version: ${{ env.PNPM_VERSION }}
63+
run_install: false
64+
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: ${{ env.NODE_VERSION }}
69+
cache: pnpm
70+
71+
- name: Install Rust
72+
uses: dtolnay/rust-toolchain@stable
4973
with:
50-
version: latest
74+
toolchain: ${{ env.RUST_TOOLCHAIN }}
5175

52-
- name: install dependencies (ubuntu only)
76+
- name: Install system dependencies (Ubuntu)
5377
if: matrix.platform == 'ubuntu-22.04'
5478
run: |
55-
sudo apt update
56-
sudo apt install libwebkit2gtk-4.1-dev \
79+
sudo apt-get update
80+
sudo apt-get install -y --no-install-recommends \
81+
libwebkit2gtk-4.1-dev \
5782
build-essential \
5883
curl \
5984
wget \
@@ -63,39 +88,31 @@ jobs:
6388
libayatana-appindicator3-dev \
6489
librsvg2-dev
6590
66-
- name: install dependencies (mac only)
91+
- name: Install system dependencies (macOS)
6792
if: matrix.platform == 'macos-latest'
6893
run: |
94+
brew install rocksdb llvm
6995
rustup target add aarch64-apple-darwin
70-
brew install g++
71-
72-
- name: Install Rust stable
73-
uses: dtolnay/rust-toolchain@stable
7496
75-
- name: Rust cache
97+
- name: Cache Rust dependencies
7698
uses: swatinem/rust-cache@v2
7799
with:
78100
workspaces: "./src-tauri -> target"
101+
cache-on-failure: true
102+
shared-key: "${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}"
79103

80-
- name: Sync node version and setup cache
81-
uses: actions/setup-node@v3
82-
with:
83-
node-version: "16"
84-
cache: "pnpm"
85-
86-
- name: Install app dependencies and build web
87-
run: pnpm install --frozen-lockfile
88-
89-
- name: submodules install
90-
run: cd it-tools && pnpm install
104+
- name: Install dependencies
105+
run: |
106+
pnpm install --frozen-lockfile
107+
cd it-tools && pnpm install --frozen-lockfile
91108
92109
- name: Build the app
93110
uses: tauri-apps/tauri-action@v0
94111
env:
95-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96113
with:
97-
tagName: ${{ github.ref_name }}
98-
releaseName: it-tools-app ${{ needs.create-release.outputs.APP_VERSION }}
114+
tagName: ${{ needs.create-release.outputs.release_tag }}
115+
releaseName: "it-tools-app ${{ needs.create-release.outputs.release_tag }}"
99116
releaseBody: ""
100117
releaseDraft: true
101118
prerelease: false

0 commit comments

Comments
 (0)