-
Notifications
You must be signed in to change notification settings - Fork 43
51 lines (50 loc) · 1.43 KB
/
release.yml
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
name: Tag, Build, Release and Publish
on:
push:
tags:
- 'v*'
jobs:
release_cli:
name: Build nj-cli
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: nj-cli
asset_name: nj-cli-linux-amd64
- os: macos-latest
artifact_name: nj-cli
asset_name: nj-cli-macos-amd64
- os: windows-latest
artifact_name: nj-cli.exe
asset_name: nj-cli.exe
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build nj-cli
run: cargo build --release --manifest-path nj-cli/Cargo.toml
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
publish_crates:
name: Publish to Crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/[email protected]
with:
crate: cargo-workspaces
version: latest
- name: Publish
run: cargo workspaces publish --token ${{ secrets.CRATES_TOKEN }} --from-git --yes