-
Notifications
You must be signed in to change notification settings - Fork 2
/
release-tauri-app.yml
136 lines (128 loc) · 4.75 KB
/
release-tauri-app.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
name: release-tauri-app
on:
push:
branches: [ release ]
paths:
- '**/package.json'
jobs:
check-build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- run: npm install
- name: build mausritter-sheet for tauri app
run: npm build
- run: cargo install tauri-bundler --force
- name: build tauri app
run: npm build:tauri
create-release:
needs: check-build
runs-on: ubuntu-latest
outputs:
RELEASE_UPLOAD_URL: ${{ steps.create_tauri_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: get version
run: echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
- name: create release
id: create_tauri_release
uses: jbolda/create-release@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ matrix.package.name }}-v${{ env.PACKAGE_VERSION }}
release_name: 'Release mausritter-sheet app v${{ env.PACKAGE_VERSION }}'
body: 'See the assets to download this version and install.'
draft: true
prerelease: false
create-and-upload-assets:
needs: create-release
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
include:
- platform: ubuntu-latest
buildFolder: bundle/deb
ext: _0.1.0_amd64.deb
compressed: ''
- platform: macos-latest
buildFolder: bundle/osx
ext: .app
compressed: .tgz
- platform: windows-latest
buildFolder: ''
ext: .x64.msi
compressed: ''
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: install webkit2gtk (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- run: yarn
- name: build mausritter-sheet for tauri app
run: yarn build
- run: cargo install tauri-bundler --force
- name: build tauri app
run: yarn tauri:build
- name: compress (macos only)
if: matrix.platform == 'macos-latest'
working-directory: ${{ format('./src-tauri/target/release/{0}', matrix.buildFolder ) }}
run: tar -czf ${{ format('mausritter-sheet{0}{1}', matrix.ext, matrix.compressed ) }} ${{ format('mausritter-sheet{0}', matrix.ext ) }}
- name: upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.RELEASE_UPLOAD_URL }}
asset_path: ${{ format('./src-tauri/target/release/{0}/mausritter-sheet{1}{2}', matrix.buildFolder, matrix.ext, matrix.compressed ) }}
asset_name: ${{ format('mausritter-sheet{0}{1}', matrix.ext, matrix.compressed ) }}
asset_content_type: application/zip
- name: build tauri app in debug mode
run: yarn tauri:build --debug
- name: compress (macos only)
if: matrix.platform == 'macos-latest'
working-directory: ${{ format('./src-tauri/target/debug/{0}', matrix.buildFolder ) }}
run: tar -czf ${{ format('mausritter-sheet{0}{1}', matrix.ext, matrix.compressed ) }} ${{ format('mausritter-sheet{0}', matrix.ext ) }}
- name: upload release asset with debug mode on
id: upload-release-asset-debug-mode
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.RELEASE_UPLOAD_URL }}
asset_path: ${{ format('./src-tauri/target/debug/{0}/mausritter-sheet{1}{2}', matrix.buildFolder, matrix.ext, matrix.compressed ) }}
asset_name: ${{ format('mausritter-sheet-debug{0}{1}', matrix.ext, matrix.compressed ) }}
asset_content_type: application/zip