Skip to content

refactor: remove fetch! macro because useless and hard to read #19

refactor: remove fetch! macro because useless and hard to read

refactor: remove fetch! macro because useless and hard to read #19

Workflow file for this run

name: Publish on NPM and crates.io
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish-js:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: 20
registry-url: 'https://registry.npmjs.com'
cache-dependency-path: 'pnpm-lock.yaml'
- name: Bump package version
run: |
sed -i "s/1.0.0/1.0.0-${GITHUB_RUN_ID}.${GITHUB_RUN_ATTEMPT}/" "package.json"
- name: Publish package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm install && pnpm build
npm publish --provenance --access public
publish-rust:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- uses: swatinem/rust-cache@v2
with:
shared-key: "cache"
- env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
cargo install cargo-release
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
cargo release patch --execute --no-tag --no-confirm