-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (108 loc) · 3.63 KB
/
build.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
name: Build LOUDBOT
on:
push:
tags:
- 'v*'
jobs:
release:
name: release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: create a github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: LOUDCRAB ${{ github.ref }}
draft: false
prerelease: false
linux:
name: linux musl build
runs-on: ubuntu-latest
needs: [release]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: x86_64-unknown-linux-musl
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: true
args: --release --target x86_64-unknown-linux-musl
- name: tar it up
run:
tar cf LOUDBOT_x64_linux.tar -C target/x86_64-unknown-linux-musl/release LOUDBOT PRUNE SEED && tar f LOUDBOT_x64_linux.tar -r SEEDS && gzip LOUDBOT_x64_linux.tar
- name: upload x64 linux musl release
id: release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.release.outputs.upload_url}}
asset_path: ./LOUDBOT_x64_linux.tar.gz
asset_name: LOUDBOT_x64_linux.tar.gz
asset_content_type: application/octet-stream
macos:
name: macos both flavors
runs-on: macos-latest
needs: [release]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- run: cargo build --release
- name: the tar thing
run:
tar cf LOUDBOT_x64_darwin.tar -C target/release LOUDBOT PRUNE SEED && tar f LOUDBOT_x64_darwin.tar -r SEEDS && gzip LOUDBOT_x64_darwin.tar
- name: upload darwin intel release
id: intel-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.release.outputs.upload_url}}
asset_path: ./LOUDBOT_x64_darwin.tar.gz
asset_name: LOUDBOT_x64_darwin.tar.gz
asset_content_type: application/octet-stream
- run: rustup target install aarch64-apple-darwin
- run: cargo build --target aarch64-apple-darwin --release
- name: the tar thing
run:
tar cf LOUDBOT_aarch64_darwin.tar -C target/release LOUDBOT PRUNE SEED && tar f LOUDBOT_aarch64_darwin.tar -r SEEDS && gzip LOUDBOT_aarch64_darwin.tar
- name: upload darwin m1 release
id: m1-release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.release.outputs.upload_url}}
asset_path: ./LOUDBOT_aarch64_darwin.tar.gz
asset_name: LOUDBOT_aarch64_darwin.tar.gz
asset_content_type: application/octet-stream