unicorn/.github/workflows/Crate-publishing.yml

83 lines
1.9 KiB
YAML
Raw Normal View History

2021-10-16 22:25:07 +03:00
name: Crate 📦 Distribution
on:
push:
paths-ignore:
- ".gitignore"
- "docs/**"
- "README"
- "CREDITS.TXT"
- "COPYING_GLIB"
- "COPYING.LGPL2"
- "AUTHORS.TXT"
- "CHANGELOG"
- "COPYING"
pull_request:
2021-10-16 22:33:19 +03:00
env:
2021-10-18 22:39:59 +03:00
UNICORN_VERSION: dev
2021-10-16 22:33:19 +03:00
2021-10-16 22:25:07 +03:00
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
strategy:
fail-fast: false
matrix:
config:
- {
os: windows-latest,
arch: x64,
name: 'Windows x86_64'
2021-10-16 22:25:07 +03:00
}
- {
os: windows-latest,
arch: x32,
2021-10-16 22:41:54 +03:00
name: 'Windows x86'
2021-10-16 22:25:07 +03:00
}
- {
os: ubuntu-latest,
arch: x64,
2021-10-16 22:41:54 +03:00
name: 'Ubuntu x86_64'
2021-10-16 22:25:07 +03:00
}
- {
os: macos-latest,
arch: x64,
name: 'macOS x86_64'
2021-10-16 22:25:07 +03:00
}
steps:
- uses: actions/checkout@v2
- name: '🛠️ Set up Rust'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
- name: '🛠️ Add msbuild to PATH'
2021-11-07 22:58:51 +03:00
if: contains(matrix.config.os, 'win')
uses: microsoft/setup-msbuild@v1.0.3
with:
vs-version: '16.5'
- name: '🛠️ Win build dependencies'
2021-11-07 22:58:51 +03:00
if: contains(matrix.config.os, 'win')
shell: bash
run: |
choco install ninja cmake
2021-10-16 22:25:07 +03:00
- name: '🚧 Cargo test'
2021-11-07 22:58:51 +03:00
if: "!startsWith(github.ref, 'refs/tags')"
env:
2021-11-10 09:51:07 +03:00
UNICORN_LOCAL: uc
2021-10-16 22:41:54 +03:00
run: |
2021-11-07 22:58:51 +03:00
cd bindings/rust && cargo test
- name: '📦 Cargo Publish'
if: startsWith(github.ref, 'refs/tags') && contains(matrix.config.os, 'ubuntu')
env:
2021-11-09 02:50:53 +03:00
TOKEN: ${{ secrets.cratesio_token }}
UNICORN_VERSION: dev
2021-11-07 22:58:51 +03:00
run: |
cd bindings/rust && cargo login $TOKEN && cargo test && cargo publish