-
Notifications
You must be signed in to change notification settings - Fork 1.5k
65 lines (56 loc) · 1.72 KB
/
Copy pathCrate-publishing.yml
File metadata and controls
65 lines (56 loc) · 1.72 KB
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
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-2022, arch: x64, name: "Windows x86_64" }
- { os: windows-2022, 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@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- 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
- name: "🛠️ macOS build dependencies"
if: contains(matrix.config.os, 'macOS')
shell: bash
run: |
brew install ninja
- name: "🚧 Cargo test"
if: "!startsWith(github.ref, 'refs/tags')"
run: |
cargo test
- name: Publish crates to Crates.io
if: startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v') && contains(matrix.config.os, 'ubuntu')
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.cratesio_token }}