-
Notifications
You must be signed in to change notification settings - Fork 97
131 lines (114 loc) · 3.99 KB
/
publish-binaries.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
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: publish binaries
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
on:
workflow_dispatch:
inputs:
releaseId:
description: 'Release Id'
required: true
type: string
repository_dispatch:
types: [publish-binaries]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe
- host: windows-latest
target: aarch64-pc-windows-msvc
ext: .exe
- host: windows-latest
target: i686-pc-windows-msvc
ext: .exe
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
setup: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu -y
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
setup: |
wget https://musl.cc/aarch64-linux-musl-cross.tgz
echo '::group::extracting'
tar -xvzf aarch64-linux-musl-cross.tgz
name: ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: setup system dependencies
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- run: cargo build --release --package create-tauri-app --target ${{ matrix.settings.target }}
if: ${{ matrix.settings.target != 'aarch64-unknown-linux-musl' }}
- run: |
export PATH="$PWD/aarch64-linux-musl-cross/bin:$PATH"
cargo build --release --package create-tauri-app --target ${{ matrix.settings.target }}
if: ${{ matrix.settings.target == 'aarch64-unknown-linux-musl' }}
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.settings.target }}"
path: target/${{ matrix.settings.target }}/release/cargo-create-tauri-app${{ matrix.settings.ext }}
if-no-files-found: error
publish:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: download all artifacts
uses: actions/download-artifact@v3
with:
path: binaries
- run: ls -R
working-directory: binaries
- name: rename files
working-directory: binaries
shell: bash
run: |
find . -name 'cargo-create-tauri-app*' -print0 | while read -d '' file
do
parent="$(basename $(dirname ${file}))"
target="${file#./}"
target="${target/cargo-create-tauri-app/create-tauri-app-${parent}}"
target="${target/${parent}\//}"
mv $file $target
done
find . -type d -empty -delete
- run: ls -R
working-directory: binaries
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: "${{ github.event.client_payload.releaseId || inputs.releaseId }}"
file: "binaries/*;create-tauri-app.sh;create-tauri-app.ps1"
draft: false