63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Publish to registries
|
|
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
crates_io:
|
|
name: Publish CLI to Crates.io
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get latest tag
|
|
id: latest_tag
|
|
run: |
|
|
echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Check out latest tag
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ steps.latest_tag.outputs.tag }}
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
|
|
- name: Publish CLI to Crates.io
|
|
uses: katyo/publish-crates@v2
|
|
with:
|
|
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
|
|
npm:
|
|
name: Publish lib to npmjs.com
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
directory: ["cli/npm", "lib/binding_web"]
|
|
steps:
|
|
- name: Get latest tag
|
|
id: latest_tag
|
|
run: |
|
|
echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Check out latest tag
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ steps.latest_tag.outputs.tag }}
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: Publish lib to npmjs.com
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
run: |
|
|
cd ${{ matrix.directory }}
|
|
npm publish
|