-
Notifications
You must be signed in to change notification settings - Fork 7
132 lines (114 loc) · 4.77 KB
/
tauri.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Tauri Build + Release
on:
push:
branches: [ develop, staging, release ]
# This workflow will build your tauri app without uploading it anywhere.
jobs:
# test:
# strategy:
# fail-fast: false
# matrix:
# platform: [macos-latest, ubuntu-latest, windows-latest]
# runs-on: ${{ matrix.platform}}
# steps:
# - uses: actions/checkout@v4
# - name: Install the Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# - name: Initialize Rust cache
# uses: swatinem/rust-cache@v2
# with:
# workspaces: './backend -> target'
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'npm'
# - name: Install dependencies (ubuntu only)
# if: matrix.platform == 'ubuntu-latest'
# run: |
# sudo apt-get update
# sudo apt-get install -y libsoup-3.0-dev libwebkit2gtk-4.1-dev javascriptcoregtk-4.1 build-essential curl wget file libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
# - name: Run unit tests
# run: |
# cd backend
# cargo test
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files
build-and-release:
needs: pre-commit
environment: ${{ github.ref_name }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos_x86-latest, macos_arm-latest, ubuntu-latest, windows-latest]
runs-on: ${{ (matrix.platform == 'macos_x86-latest' || matrix.platform =='macos_arm-latest' ) && 'macos-latest' || matrix.platform}}
steps:
- uses: actions/checkout@v4
- name: Install the Rust toolchain
uses: dtolnay/rust-toolchain@stable
- if: matrix.platform == 'macos_arm-latest'
name: Install ARM Rust target
run: rustup target add aarch64-apple-darwin
- name: Initialize Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './backend -> target'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libsoup-3.0-dev libwebkit2gtk-4.1-dev patchelf javascriptcoregtk-4.1 build-essential curl wget file libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2.0.0-beta.1"
# If tagName and releaseId are omitted tauri-action will only build the app and won't try to upload any asstes.
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
API: ${{ secrets.AVAIL_API_URL}}
DEV_NODE_IP: ${{ secrets.DEV_NODE_IP}}
TESTNET_API_OBSCURA: ${{ secrets.TESTNET_API_OBSCURA}}
MAINNET_API_OBSCURA: ""
DEVNET_API_OBSCURA: ""
with:
# Use the tauri-cli we installed earlier
tauriScript: cargo tauri
# Build for the ARM architecture on macOS
args: ${{ matrix.platform == 'macos_arm-latest' && ' --target aarch64-apple-darwin' || '' }}
projectPath: backend
distPath: frontend/dist
# The tagName is alpha for develop, beta for staging and latest for release
tagName: "v__VERSION__-${{ vars.TAGNAME }}"
releaseName: "Avail Wallet v__VERSION__-${{ vars.TAGNAME }}"
# The release body is optional, but it's a good place to put release notes
releaseBody: 'See the assets to download this version and install.'
# Always create a draft release, so we can check the assets before publishing
releaseDraft: true
# Only publish the release if the branch is release
prerelease: ${{ github.ref_name == 'release' && false || true }}