First attempt towards Windows support #96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pre-release | |
on: | |
pull_request: | |
branches: | |
- "main" | |
types: [opened,labeled,edited,synchronize] | |
jobs: | |
test-artifacts: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
env: | |
RUST_BACKTRACE: 1 | |
RUST_LIB_BACKTRACE: 1 | |
TOKIO_WORKER_THREADS: 1 | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
command: test | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
command: build | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
command: test | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
command: test | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup for Windows | |
if: matrix.os == 'windows-latest' | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.9 | |
- name: Add target | |
run: rustup target add ${{ matrix.target }} | |
- name: Cross-compile | |
run: cargo ${{ matrix.command }} --locked --target ${{ matrix.target }} | |
publish-dry-run: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to crates.io | |
run: cargo login ${{ secrets.CRATES_IO_TOKEN }} | |
- name: Dry run of crate publish | |
run: cargo publish -p depot-js --dry-run | |
check-pr-name: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check that PR name is a release number | |
run: echo "${{ github.event.pull_request.title }}" | grep -q -E "^v[0-9]+\.[0-9]+\.[0-9]+$" |