-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (120 loc) · 4.44 KB
/
build-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
133
134
name: 'Build & Release Tauri app'
on:
workflow_dispatch:
inputs:
release_message:
description: 'Message to write in the release'
required: true
type: string
default: '[Changelog](https://github.com/UnofficialCrusaderPatch/UCP3-GUI/wiki/Changelog#)'
pre_release:
description: 'Pre release?'
required: true
default: true
type: boolean
env:
RELEASE_BODY: ''
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: install app dependencies
run: |
npm ci
- name: Create changelog URL
run: |
$m = "${{ inputs.release_message }}"
$t = "[Changelog](https://github.com/UnofficialCrusaderPatch/UCP3-GUI/wiki/Changelog#)"
if ( $m.Contains($t) ) {
Install-Module -Name PSToml -Scope CurrentUser -Force
Import-Module PSToml
## Get the version
$conf = Get-Content -Raw -Path "src-tauri/Cargo.toml" | ConvertFrom-Toml
$v = $conf.package.version
$vm = $v.Replace(".", "") # Needed this way for pound urls
## Create the version URL
$url = $t.Replace("#", "#v$vm")
$n = $m.Replace($t, $url)
## Write the url
echo "RELEASE_BODY=$n" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "RELEASE_BODY=$m" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
shell: pwsh
- name: Build the app and publish it
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
includeRelease: true
includeUpdaterJson: true
updaterJsonPreferNsis: true
tagName: v__VERSION__
releaseName: 'UCP3-GUI: v__VERSION__'
releaseBody: '${{ env.RELEASE_BODY }}'
releaseDraft: false
prerelease: ${{ inputs.pre_release }}
# TODO: include owner and repo to push to the main UCP repo
- name: Push release to auto updater
if: ${{ inputs.pre_release == false }}
uses: exuanbo/actions-deploy-gist@v1
with:
token: '${{ secrets.UCP3_MACHINE_GIST_TOKEN }}'
gist_id: 2a179c892f49448c85dfcc9e5f9a3c6b
file_path: latest.json
file_type: text
# - name: create latest.json
# shell: pwsh
# run: |
# $json = Get-Content .\src-tauri\tauri.conf.json | ConvertFrom-Json
# $version = $json.package.version
# $latest = @{
# 'version' = $version
# 'notes' = "Latest Tauri build"
# 'pub_date' = Get-Date -Format "o"
# 'platforms' = @{
# 'windows-x86_64' = @{
# 'signature' = ''
# 'url' = '' # Don't know how to solve this with a private repo
# }
# }
# }
# ConvertTo-Json $latest | Set-Content -Path latest.json
# - uses: 'marvinpinto/action-automatic-releases@latest'
# with:
# repo_token: '${{ secrets.GITHUB_TOKEN }}'
# automatic_release_tag: 'latest'
# prerelease: true
# draft: false
# title: 'Tauri Development Build'
# files: |
# latest.json
# src-tauri/target/release/*.exe
# src-tauri/target/release/*.zip
# src-tauri/target/release/*.sig
# src-tauri/target/release/bundle/msi/*.msi
# src-tauri/target/release/bundle/msi/*.zip
# src-tauri/target/release/bundle/msi/*.sig
# src-tauri/target/release/bundle/nsis/*.nsis
# src-tauri/target/release/bundle/nsis/*.zip
# src-tauri/target/release/bundle/nsis/*.sig