Skip to content

Commit 4fe6984

Browse files
authored
feat: build + release Workflow (#9)
1 parent c3dea4b commit 4fe6984

File tree

10 files changed

+150
-71
lines changed

10 files changed

+150
-71
lines changed

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: release-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
publish:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform: [macos-latest, ubuntu-latest, windows-latest]
19+
20+
runs-on: ${{ matrix.platform }}
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: pnpm/[email protected]
24+
with:
25+
version: 7
26+
run_install: true
27+
28+
- name: Use Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: '16'
32+
cache: 'pnpm'
33+
34+
- name: install Rust stable
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
toolchain: stable
38+
39+
- name: install dependencies (ubuntu only)
40+
if: matrix.platform == 'ubuntu-latest'
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
44+
45+
- name: Build Vite + Tauri
46+
run: pnpm build
47+
48+
- name: Create release
49+
uses: tauri-apps/tauri-action@v0
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
54+
releaseName: 'v__VERSION__'
55+
releaseBody: 'See the assets to download and install this version.'
56+
releaseDraft: true
57+
prerelease: false

.github/workflows/test-build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/**'
9+
- 'src-tauri/**'
10+
- 'tests/**'
11+
- 'pnpm-lock.yaml'
12+
- '.github/workflows/test.yml'
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: build-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test-build:
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
platform: [macos-latest, ubuntu-latest, windows-latest]
25+
26+
runs-on: ${{ matrix.platform }}
27+
steps:
28+
- uses: actions/checkout@v3
29+
30+
- name: Install pnpm + deps
31+
uses: pnpm/[email protected]
32+
with:
33+
version: 7
34+
run_install: true
35+
36+
- name: Use Node.js
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: 16
40+
cache: 'pnpm'
41+
42+
- name: Install Rust stable
43+
uses: actions-rs/toolchain@v1
44+
with:
45+
toolchain: stable
46+
47+
- name: Install Linux dependencies
48+
if: matrix.platform == 'ubuntu-latest'
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
52+
53+
- name: Build Vite + Tauri
54+
run: pnpm build

.github/workflows/test.yml

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v3
31-
32-
- name: Cache pnpm modules
33-
uses: actions/cache@v3
34-
with:
35-
path: /home/runner/.local/share/pnpm/store
36-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
37-
restore-keys: |
38-
${{ runner.os }}-
3931
- uses: pnpm/[email protected]
4032
with:
41-
version: 7.0.0-rc.8
33+
version: 7
4234
run_install: true
4335

4436
- name: Use Node.js
@@ -49,52 +41,3 @@ jobs:
4941

5042
- name: Run unit tests
5143
run: pnpm test
52-
53-
build:
54-
needs: [test]
55-
if: ${{ github.event.pull_request.merged }}
56-
strategy:
57-
fail-fast: false
58-
matrix:
59-
platform: [macos-latest, ubuntu-latest, windows-latest]
60-
61-
runs-on: ${{ matrix.platform }}
62-
steps:
63-
- uses: actions/checkout@v3
64-
65-
- name: Cache pnpm modules
66-
uses: actions/cache@v3
67-
with:
68-
path: /home/runner/.local/share/pnpm/store
69-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
70-
restore-keys: |
71-
${{ runner.os }}-
72-
73-
- uses: pnpm/[email protected]
74-
with:
75-
version: 7.0.0-rc.8
76-
run_install: true
77-
78-
- name: Use Node.js
79-
uses: actions/setup-node@v3
80-
with:
81-
node-version: '16'
82-
cache: 'pnpm'
83-
84-
- name: Install Rust stable
85-
uses: actions-rs/toolchain@v1
86-
with:
87-
toolchain: stable
88-
89-
- name: Install Linux dependencies
90-
if: matrix.platform == 'ubuntu-latest'
91-
run: |
92-
sudo apt-get update
93-
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libayatana-appindicator3-dev
94-
95-
- name: Build Vite + Tauri
96-
run: pnpm build
97-
98-
- uses: tauri-apps/tauri-action@v0
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.1.0 (2022-06-16)
4+
5+
Hello Tauri 1.0!
6+
7+
- Feat: Added a separate release workflow.
8+
- Refactor: converted menu to use `Menu::os_default`. Thank You to @JonasKruckenberg! for the tip!
9+
- Docs: added more docs on usage, fixed prerequisites link.
10+
- Chore: Bumped all Vite + Tauri deps.
11+
312
## 0.0.1 (2022-04-27)
413

514
- Initial version

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ pnpm i
2323

2424
## Usage
2525

26+
### Development
27+
2628
#### Running Tauri + Vite Development Server
2729

2830
```sh
@@ -35,17 +37,30 @@ pnpm dev
3537
pnpm test
3638
```
3739

40+
#### Upgrading Rust Dependencies
41+
42+
You can upgrade your Rust dependencies with the included [cargo-edit](https://github.com/killercup/cargo-edit) tool. In `src-tauri/` say
43+
44+
```sh
45+
cargo upgrade
46+
```
47+
48+
### Building and releasing
49+
3850
#### Building
3951

52+
The project has GitHub Actions set up which will automatically test and build your app with every push and PR. For building manually:
53+
4054
```sh
4155
pnpm build
4256
```
4357

44-
## Roadmap
58+
#### Releasing a new version
4559

46-
- [x] Add basic usability features
47-
- [ ] Build + release with GitHub Actions
48-
- [ ] Add documentation for devtools etc
60+
1. Bump version number (In `package.json`, and `src-tauri/`)
61+
2. Run `pnpm check` to update `Cargo.lock`
62+
3. Tag the commit you want to release with `vX.Y.Z`
63+
4. Github workflow will automatically build a new draft release for this version. Edit the release notes and publish when ready 🎉
4964

5065
## Elsewhere
5166

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
2-
"name": "tauri-vite-template",
2+
"name": "tauri-vue-template",
33
"private": true,
4-
"version": "0.0.2",
4+
"version": "0.1.0",
55
"scripts": {
66
"dev": "vite-tauri dev",
77
"build": "vite-tauri build",
88
"vite:dev": "vite dev",
99
"vite:build": "vite build",
1010
"test": "vitest",
1111
"ts-check": "vue-tsc --noEmit",
12-
"preview": "vite preview"
12+
"preview": "vite preview",
13+
"check": "cd src-tauri && cargo check"
1314
},
1415
"dependencies": {
1516
"@tauri-apps/api": "1.0.0",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "app"
3-
version = "0.0.1"
3+
version = "0.1.0"
44
description = "A Tauri App"
55
authors = ["Ville Säävuori"]
66
license = "MIT"

src-tauri/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn main() {
1717
tauri::Builder::default()
1818
.invoke_handler(tauri::generate_handler![backend_add])
1919
.menu(
20-
tauri::Menu::os_default("Tauri Vite Template").add_submenu(Submenu::new(
20+
tauri::Menu::os_default("Tauri Vue Template").add_submenu(Submenu::new(
2121
"Help",
2222
Menu::with_items([CustomMenuItem::new(
2323
"Online Documentation",

src-tauri/tauri.conf.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"package": {
3-
"productName": "tauri-vite-template",
4-
"version": "0.0.1"
3+
"productName": "tauri-vue-template",
4+
"version": "0.1.0"
55
},
66
"build": {
77
"distDir": "../dist",
@@ -51,7 +51,7 @@
5151
},
5252
"windows": [
5353
{
54-
"title": "tauri-vite-template",
54+
"title": "tauri-vue-template",
5555
"width": 800,
5656
"height": 600,
5757
"resizable": true,

0 commit comments

Comments
 (0)