-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (124 loc) · 3.77 KB
/
pre-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
136
137
138
139
140
141
142
143
name: pre-release
on:
push:
branches: [ master ]
paths-ignore: [ '*.md' ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
SHORT_NAME: dc
CRATE_NAME: msgist-dc
jobs:
compile:
name: Compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
release_name: x86_64-linux
postfix: ""
extra_args: ""
cross: true
- os: ubuntu-latest
target: i686-unknown-linux-musl
release_name: i686-linux
postfix: ""
extra_args: ""
cross: true
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
release_name: aarch64-linux
postfix: ""
extra_args: ""
cross: true
# Windows GNU
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
release_name: x86_64-windows.exe
postfix: ".exe"
extra_args: --no-default-features --features no-color
cross: true
- os: ubuntu-latest
target: i686-pc-windows-gnu
release_name: i686-windows.exe
postfix: ".exe"
extra_args: --no-default-features --features no-color
cross: true
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
release_name: x86_64-windows-colored.exe
postfix: ".exe"
extra_args: ""
cross: true
- os: ubuntu-latest
target: i686-pc-windows-gnu
release_name: i686-windows-colored.exe
postfix: ".exe"
extra_args: ""
cross: true
# Mac OSX
- os: macos-latest
target: x86_64-apple-darwin
release_name: x86_64-mac
postfix: ""
extra_args: ""
cross: false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Resume cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.target }}-release-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ matrix.target }}-release
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-01
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --target ${{ matrix.target }} ${{ matrix.extra_args }}
- name: Rename binary
run: mv target/${{ matrix.target }}/release/${{ env.CRATE_NAME }}${{ matrix.postfix }} ${{ env.SHORT_NAME }}-${{ matrix.release_name }}
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: compile
path: ${{ env.SHORT_NAME }}-${{ matrix.release_name }}
release:
name: Release
permissions: write-all
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: compile
path: ./packages
- name: Compress
run: bash ./.github/compress.sh
- name: Github release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: latest
prerelease: true
title: "Bleeding edge/前沿发行版"
files: |
packages/*
LICENSE