-
Notifications
You must be signed in to change notification settings - Fork 21
91 lines (89 loc) · 3.05 KB
/
build-online-installer-dispatch.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
name: "build-installer"
on:
workflow_dispatch:
inputs:
upload_artifacts:
description: 'Upload final artifacts to Release?'
required: true
default: 'yes'
jobs:
get_release:
# https://github.com/octokit/request-action
name: Get release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.get_upload_url.outputs.url }}
steps:
- uses: octokit/[email protected]
id: get_latest_release
with:
#route: GET /repos/{owner}/{repo}/releases/latest
route: GET /repos/{owner}/{repo}/releases/tag/untagged-a7c69a969e15962b4f94
owner: espressif
repo: idf-installer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: get upload url
id: get_upload_url
run: |
url=$(echo "$response" | jq -r '.upload_url')
echo "::set-output name=url::$url"
env:
response: ${{ steps.get_latest_release.outputs.data }}
build-tauri:
needs: get_release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
include:
- os: macos-latest
ASSET_PATH: 'src-tauri/target/release/idf-installer'
ASSET_NAME: 'idf-installer-apple'
ASSET_CONTENT_TYPE: 'application/octet-stream'
- os: ubuntu-latest
ASSET_PATH: 'src-tauri/target/release/idf-installer'
ASSET_NAME: 'idf-installer-linux'
ASSET_CONTENT_TYPE: 'application/octet-stream'
- os: windows-latest
ASSET_PATH: 'src-tauri/target/release/idf-installer-signed.exe'
ASSET_NAME: 'idf-installer-windows.exe'
ASSET_CONTENT_TYPE: 'application/octet-stream'
steps:
- uses: actions/checkout@v3
- 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.os == 'ubuntu-latest'
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: yarn && yarn build
- name: build the app - Rust part
run: yarn tauri:build
- name: Sign binary
if: matrix.os == 'windows-latest'
env:
CERTIFICATE: ${{ secrets.CERTIFICATE }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
shell: pwsh
run: .\Build-Installer.ps1
- name: Upload Release Asset
if: github.event.inputs.upload_artifacts == 'yes'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.get_release.outputs.upload_url }}
asset_path: ${{ matrix.ASSET_PATH }}
asset_name: ${{ matrix.ASSET_NAME }}
asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }}