Skip to content

Commit

Permalink
Release independent packages
Browse files Browse the repository at this point in the history
Generated by cargo-workspaces
  • Loading branch information
ivanleomk committed Jul 8, 2024
1 parent 7f51343 commit 434567f
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
name: Cargo Build & Test
name: Deploy

on:
release:
types: [published]
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
publish:
name: Publish to crates.io
build-and-upload:
name: Build and upload
runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
environment: crates.io
strategy:
matrix:
# You can add more, for any target you'd like!
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl

- build: macos
os: macos-latest
target: x86_64-apple-darwin

steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2

- name: Publish
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials
run: >
cargo workspaces publish
--verbose
--allow-branch *
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Get the release version from the tag
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Install Rust
run: rustup target add ${{ matrix.target }}

- name: Publish to Cargo
run: |
cargo workspaces publish --verbose --allow-branch * --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 434567f

Please sign in to comment.