This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
128 lines (115 loc) · 4.32 KB
/
release-binary.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
name: Release
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * * # At the end of everyday
pull_request:
paths-ignore:
- '.github/**'
release:
types: [published]
# Cancel previous runs of the same workflow on the same branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-warp:
defaults:
run:
working-directory: moq-server
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
bundles: dmg
asset_name: warp-macos-amd64
- host: macos-latest
target: aarch64-apple-darwin
bundles: dmg
asset_name: warp-macos-apple-silicon
- host: windows-latest
target: x86_64-pc-windows-msvc
bundles: msi
asset_name: warp-windows-amd64
# - host: windows-latest
# target: aarch64-pc-windows-msvc
- host: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bundles: appimage
asset_name: warp-ubuntu-amd64
# - host: ubuntu-20.04
# target: x86_64-unknown-linux-musl
# - host: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
# - host: ubuntu-20.04
# target: aarch64-unknown-linux-musl
# - host: ubuntu-20.04
# target: armv7-unknown-linux-gnueabihf
name: Warp for ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
toolchain: stable
components: clippy, rustfmt
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
with:
save-if: false
prefix-key: 'v0-rust-deps'
shared-key: ${{ matrix.settings.target }}
- name: Build
run: cargo build --target ${{ matrix.settings.target }} --manifest-path ./moq-pub/Cargo.toml --release
- name: Copy and rename artifacts (Linux)
if: ${{ matrix.settings.host == 'ubuntu-20.04' }}
run: |
cp target/${{ matrix.settings.target }}/release/moq-pub ./warp
- name: Copy and rename artifacts (Windows)
if: ${{ matrix.settings.host == 'windows-latest' }}
run: |
cp "target/${{ matrix.settings.target }}/release/moq-pub.exe" ./warp.exe
- name: Copy and rename artifacts (macOS)
if: ${{ matrix.settings.host == 'macos-latest' }}
run: |
cp target/${{ matrix.settings.target }}/release/moq-pub ./warp
- name: Publish artifacts (${{ matrix.settings.host }})
if: ${{ matrix.settings.host == 'windows-latest' && github.event_name != 'release' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.settings.asset_name }}
path: ./moq-server/warp.exe
if-no-files-found: error
retention-days: 5
- name: Publish artifacts (${{ matrix.settings.host }})
if: ${{ matrix.settings.host != 'windows-latest' && github.event_name != 'release' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.settings.asset_name }}
path: ./moq-server/warp
if-no-files-found: error
retention-days: 5
- name: Publish release for (${{ matrix.settings.host }})
if: ${{ matrix.settings.host == 'windows-latest' && github.event_name == 'release' }}
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./moq-server/warp.exe
asset_name: ${{ matrix.settings.asset_name }}
tag: ${{ github.ref }}
- name: Publish release for (${{ matrix.settings.host }})
if: ${{ matrix.settings.host != 'windows-latest' && github.event_name == 'release' }}
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./moq-server/warp
asset_name: ${{ matrix.settings.asset_name }}
tag: ${{ github.ref }}