-
Notifications
You must be signed in to change notification settings - Fork 32
135 lines (124 loc) · 3.79 KB
/
nightly-release.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
135
name: Nightly Release
on:
workflow_dispatch:
schedule: # Every day at the 2 P.M. (UTC) we run a scheduled nightly build
- cron: "0 14 * * *"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build (${{ matrix.config.arch }})
strategy:
matrix:
config:
- os: windows-latest
arch: win-x64
- os: ubuntu-latest
arch: linux-x64
- os: macos-latest
arch: macos-x64
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
override: true
- name: Install libudev for Linux (optional)
if: runner.os == 'Linux'
run: sudo apt-get install libudev-dev
- name: Build
run: cargo build --release
- name: Run help
run: cargo run --release -- --help
- name: Compress binary
run: |
mkdir -p release
cp target/release/wlink release/ || true
cp target/release/wlink.exe release/ || true
cp README.md release/
(cd release/ && tar -czvf ../wlink-${{ matrix.config.arch }}.tar.gz *)
shell: bash
- uses: actions/upload-artifact@v3
with:
name: wlink-binaries
path: wlink-${{ matrix.config.arch }}.tar.gz
build-win-x86:
name: build (windows-x86)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: i686-pc-windows-msvc
components: rustfmt, clippy
override: true
- name: Build
run: cargo build --release --target i686-pc-windows-msvc
- name: Compress binary
run: |
mkdir -p release
cp target/i686-pc-windows-msvc/release/wlink.exe release/
cp README.md release/
(cd release/ && tar -czvf ../wlink-win-x86.tar.gz *)
- uses: actions/upload-artifact@v3
with:
name: wlink-binaries
path: wlink-win-x86.tar.gz
build-macos-arm64:
name: build (macos-arm64)
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: aarch64-apple-darwin
components: rustfmt, clippy
override: true
- name: Build
run: cargo build --release --target aarch64-apple-darwin
- name: Compress binary
run: |
mkdir -p release
cp target/aarch64-apple-darwin/release/wlink release/
cp README.md release/
(cd release/ && tar -czvf ../wlink-macos-arm64.tar.gz *)
- uses: actions/upload-artifact@v3
with:
name: wlink-binaries
path: wlink-macos-arm64.tar.gz
release:
needs: [build, build-macos-arm64, build-win-x86]
runs-on: ubuntu-22.04
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: wlink-binaries
path: ./
- name: List files
run: ls -R ./
shell: bash
- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: "wlink Nightly Release $$"
draft: false
prerelease: false
body: |
This is a nightly binary release of the wlink command line tool.
For Windows users, please use the x86 version since it has the Windows driver support.
files: |
wlink-*.tar.gz