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

81 lines
1.8 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:
- {
2022-02-17 12:47:31 +03:00
os: windows-2019,
2021-10-16 22:25:07 +03:00
arch: x64,
name: 'Windows x86_64'
2021-10-16 22:25:07 +03:00
}
- {
2022-02-17 12:47:31 +03:00
os: windows-2019,
2022-04-12 23:41:50 +03:00
arch: x86,
2021-10-16 22:41:54 +03:00
name: 'Windows x86'
2021-10-16 22:25:07 +03:00
}
- {
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
}
- {
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
2022-04-12 23:39:44 +03:00
- name: '🛠️ Activate Developer Command Prompt'
2021-11-07 22:58:51 +03:00
if: contains(matrix.config.os, 'win')
2022-04-12 23:39:44 +03:00
uses: ilammy/msvc-dev-cmd@v1
with:
2022-04-12 23:39:44 +03:00
arch: ${{ matrix.config.arch }}
- 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')"
2021-10-16 22:41:54 +03:00
run: |
cargo test
2021-11-07 22:58:51 +03:00
- 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: |
cargo login $TOKEN && cargo test && cargo publish