Skip to content

Commit e9d5959

Browse files
committed
refactor(ci): update release-ci to build rustmail-panel
1 parent 67ede6c commit e9d5959

1 file changed

Lines changed: 68 additions & 29 deletions

File tree

.github/workflows/release-ci.yml

Lines changed: 68 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,24 @@ jobs:
2525
- nightly
2626
steps:
2727
- uses: actions/checkout@v4
28-
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
29-
- run: cargo build --verbose
30-
- run: cargo test --verbose
28+
29+
- name: Set up Rust
30+
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
31+
32+
- name: Install trunk and wasm target
33+
run: |
34+
rustup target add wasm32-unknown-unknown
35+
cargo install trunk --locked
36+
37+
- name: Build frontend
38+
working-directory: rustmail_panel
39+
run: trunk build --release --dist ../rustmail/static --config Trunk.toml
40+
41+
- name: Build Rust backend
42+
run: cargo build --verbose -p rustmail
43+
44+
- name: Run tests
45+
run: cargo test --verbose -p rustmail
3146

3247
create-release:
3348
name: Create Release
@@ -44,35 +59,59 @@ jobs:
4459
else
4560
prerelease=""
4661
fi
47-
62+
4863
gh release create "$tag" \
4964
--repo="$GITHUB_REPOSITORY" \
5065
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
5166
--generate-notes $prerelease
5267
5368
upload-assets:
54-
needs: create-release
55-
strategy:
56-
matrix:
57-
include:
58-
- target: x86_64-unknown-linux-gnu
59-
os: ubuntu-latest
60-
- target: x86_64-apple-darwin
61-
os: macos-latest
62-
- target: x86_64-pc-windows-msvc
63-
os: windows-latest
64-
runs-on: ${{ matrix.os }}
65-
steps:
66-
- uses: actions/checkout@v4
67-
- uses: taiki-e/upload-rust-binary-action@v1
68-
with:
69-
70-
bin: rustmail
71-
72-
target: ${{ matrix.target }}
73-
74-
tar: unix
75-
76-
zip: windows
77-
78-
token: ${{ secrets.GT_TOKEN }}
69+
needs: create-release
70+
strategy:
71+
matrix:
72+
include:
73+
- target: x86_64-unknown-linux-gnu
74+
os: ubuntu-latest
75+
- target: x86_64-apple-darwin
76+
os: macos-latest
77+
- target: x86_64-pc-windows-msvc
78+
os: windows-latest
79+
runs-on: ${{ matrix.os }}
80+
env:
81+
SQLX_OFFLINE: true
82+
steps:
83+
- uses: actions/checkout@v4
84+
85+
- name: Install Rust
86+
run: rustup update stable && rustup default stable
87+
88+
- name: Add wasm32 target
89+
run: rustup target add wasm32-unknown-unknown
90+
91+
- name: Install trunk
92+
run: cargo install trunk --locked
93+
94+
- name: Create static directory
95+
run: mkdir -p rustmail/static
96+
shell: bash
97+
98+
- name: Build frontend
99+
working-directory: rustmail_panel
100+
run: trunk build --release --dist ../rustmail/static --config Trunk.toml
101+
102+
- name: Verify static files were created
103+
run: ls rustmail/static
104+
shell: bash
105+
106+
- uses: taiki-e/upload-rust-binary-action@v1
107+
with:
108+
109+
bin: rustmail
110+
111+
target: ${{ matrix.target }}
112+
113+
tar: unix
114+
115+
zip: windows
116+
117+
token: ${{ secrets.GT_TOKEN }}

0 commit comments

Comments
 (0)