-
Notifications
You must be signed in to change notification settings - Fork 1.4k
87 lines (78 loc) · 1.98 KB
/
Crate-publishing.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
name: Crate 📦 Distribution
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "README"
- "CREDITS.TXT"
- "COPYING_GLIB"
- "COPYING.LGPL2"
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
pull_request:
env:
UNICORN_VERSION: dev
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: windows-2019,
arch: x64,
name: 'Windows x86_64'
}
- {
os: windows-2019,
arch: x86,
name: 'Windows x86'
}
- {
os: ubuntu-latest,
arch: x64,
name: 'Ubuntu x86_64'
}
- {
os: macos-latest,
arch: x64,
name: 'macOS x86_64'
}
steps:
- uses: actions/checkout@v2
- name: '🛠️ Set up Rust'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
- name: '🛠️ Activate Developer Command Prompt'
if: contains(matrix.config.os, 'win')
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.config.arch }}
- name: '🛠️ Win build dependencies'
if: contains(matrix.config.os, 'win')
shell: bash
run: |
choco install ninja cmake
- name: '🛠️ macOS build dependencies'
if: contains(matrix.config.os, 'macOS')
shell: bash
run: |
brew install p7zip cmake ninja pkg-config
- name: '🚧 Cargo test'
if: "!startsWith(github.ref, 'refs/tags')"
run: |
cargo test
- name: '📦 Cargo Publish'
if: startsWith(github.ref, 'refs/tags') && contains(matrix.config.os, 'ubuntu')
env:
TOKEN: ${{ secrets.cratesio_token }}
UNICORN_VERSION: dev
run: |
cargo login $TOKEN && cargo test && cargo publish