bumping version because npm hates me #13
Workflow file for this run
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
on: | |
push: | |
tags: | |
- "*" | |
name: build and publish to npm | |
jobs: | |
build: | |
name: Build - ${{ matrix.platform.os }} ${{ matrix.arch }} | |
strategy: | |
matrix: | |
platform: | |
- os: linux | |
target_suffix: -unknown-linux-gnu | |
output: libvenbind.so | |
arch: [x86_64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: cachix/install-nix-action@v26 | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: devenv | |
- name: Install devenv.sh | |
run: nix profile install nixpkgs#devenv | |
- name: Build | |
shell: devenv shell bash -- -e {0} | |
run: | | |
cargo build --release --target ${{ matrix.arch }}${{ matrix.platform.target_suffix }} | |
mkdir dist | |
cp ./target/${{ matrix.arch }}${{ matrix.platform.target_suffix }}/release/${{ matrix.platform.output }} ./dist/venbind-${{ matrix.platform.os }}-${{ matrix.arch }}.node | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.platform.os }}-${{ matrix.arch }} | |
path: ./dist/venbind-${{ matrix.platform.os }}-${{ matrix.arch }}.node | |
publish: | |
name: Publish | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# TODO: check tag and make sure it matches across tag, package.json, and Cargo.toml | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: prebuilds | |
- name: Publish to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |