Skip to content

Commit acc1d86

Browse files
committed
new ci
Signed-off-by: Pushkar Mishra <[email protected]>
1 parent 23921d9 commit acc1d86

File tree

2 files changed

+66
-13
lines changed

2 files changed

+66
-13
lines changed

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: 'publish'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
9+
10+
jobs:
11+
publish-tauri:
12+
permissions:
13+
contents: write
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
19+
args: '--target aarch64-apple-darwin'
20+
- platform: 'macos-latest' # for Intel based macs.
21+
args: '--target x86_64-apple-darwin'
22+
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
23+
args: ''
24+
- platform: 'windows-latest'
25+
args: ''
26+
27+
runs-on: ${{ matrix.platform }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: setup node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: lts/*
35+
36+
- name: install Rust stable
37+
uses: dtolnay/rust-toolchain@stable
38+
with:
39+
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
40+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
41+
42+
- name: install dependencies (ubuntu only)
43+
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
47+
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
48+
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
49+
50+
- name: install frontend dependencies
51+
run: yarn install # change this to npm, pnpm or bun depending on which one you use.
52+
53+
- uses: tauri-apps/tauri-action@v0
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
58+
releaseName: 'App v__VERSION__'
59+
releaseBody: 'See the assets to download this version and install.'
60+
releaseDraft: true
61+
prerelease: false
62+
args: ${{ matrix.args }}

.github/workflows/release.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
- name: Install frontend dependencies
4848
run: bun install
4949

50+
- name: Update Tauri version
51+
run: |
52+
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"${{ env.VERSION }}\"/" src-tauri/tauri.conf.json
53+
5054
- name: Build for release
5155
uses: tauri-apps/tauri-action@v0
5256
env:
@@ -57,16 +61,3 @@ jobs:
5761
releaseBody: 'See the assets to download this version and install.'
5862
releaseDraft: true
5963
prerelease: false
60-
61-
- name: Upload release bundles
62-
if: success()
63-
uses: softprops/action-gh-release@v1
64-
with:
65-
files: |
66-
src-tauri/target/release/bundle/deb/nearchat_${{ env.VERSION }}_amd64.deb
67-
src-tauri/target/release/bundle/rpm/nearchat-${{ env.VERSION }}-1.x86_64.rpm
68-
src-tauri/target/release/bundle/appimage/nearchat_${{ env.VERSION }}_amd64.AppImage
69-
tag_name: ${{ github.ref_name }}
70-
draft: true
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)