-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (127 loc) · 4.6 KB
/
tui.publish.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: 'publish'
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
settings:
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''
runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn' # Set this to npm, yarn or pnpm.
cache-dependency-path: './tui/yarn.lock'
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.settings.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './tui/src-tauri -> target'
- name: install frontend dependencies
working-directory: ./tui
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install # change this to npm or pnpm depending on which one you use.
- name: build frontend
working-directory: ./tui
run: yarn tauri build # change this to npm or pnpm depending on
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: TUI
path: |
./tui/src-tauri/target/release/bundle/nsis/tui_*.exe
./tui/src-tauri/target/release/bundle/msi/tui_*.msi
./tui/src-tauri/target/release/bundle/deb/tui_*.deb
./tui/src-tauri/target/release/bundle/rpm/tui_*.rpm
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: TUI
# path: |
# ./tui/yarn.lock
# - uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
# releaseName: 'App v__VERSION__'
# releaseBody: 'See the assets to download this version and install.'
# releaseDraft: true
# prerelease: false
# args: ${{ matrix.settings.args }}
release:
runs-on: ubuntu-latest
needs: publish-tauri
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: TUI
path: ./artifacts
- name: Create Release
run: |
set -x
assets=()
for asset in ./artifacts/**/*; do
assets+=("$asset")
done
tag_name=${{ github.ref }}
gh release create "$tag_name" "${assets[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# gh release upload v0.0.1 ./dist/**/tui_*.exe
# gh release upload v0.0.1 ./dist/**/tui_*.msi
# gh release upload v0.0.1 ./dist/**/tui_*.deb
# gh release upload v0.0.1 ./dist/**/tui_*.rpm
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./dist/
# asset_name: your_executable_name
# asset_content_type: application/octet-stream
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# # tag_name: ${{ github.ref }}
# tag_name: v0.0.1
# release_name: Release v0.0.1
# draft: false
# prerelease: false
# - name: Custom upload release asset
# run: |
# echo "Uploading asset..."
# ls -la ./dist
# gh release upload v0.0.1 ./dist/yarn.lock
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}