Skip to content

release: v0.2.0-beta.8.1 — cleanup fixes #30

release: v0.2.0-beta.8.1 — cleanup fixes

release: v0.2.0-beta.8.1 — cleanup fixes #30

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-and-release:
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
os: windows-latest
ext: .exe
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
ext: ""
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
ext: ""
- target: x86_64-apple-darwin
os: macos-latest
ext: ""
- target: aarch64-apple-darwin
os: macos-latest
ext: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install musl tools (Linux cross)
if: contains(matrix.target, 'musl')
run: |
sudo apt-get update -qq
sudo apt-get install -y musl-tools
if [[ "${{ matrix.target }}" == "aarch64"* ]]; then
# cargo-zigbuild uses zig's bundled musl headers instead of glibc cross-compiler
# headers, which avoids open64/stat64/__*_chk symbols that don't exist in musl.
pip3 install ziglang
cargo install cargo-zigbuild --locked
fi
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build
shell: bash
run: |
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-musl" ]]; then
cargo zigbuild --release --target "${{ matrix.target }}"
else
cargo build --release --target "${{ matrix.target }}"
fi
- name: Package binary
shell: bash
run: |
BIN="infynon${{ matrix.ext }}"
SRC="target/${{ matrix.target }}/release/$BIN"
DEST="infynon-${{ matrix.target }}${{ matrix.ext }}"
cp "$SRC" "$DEST"
echo "ASSET=$DEST" >> $GITHUB_ENV
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ASSET }}
publish-npm:
name: Publish to npm
needs: build-and-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Sync version from tag
shell: bash
run: |
TAG="${GITHUB_REF_NAME#v}"
cd npm
node -e "
const pkg = require('./package.json');
pkg.version = '$TAG';
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
"
echo "Publishing version $TAG"
- name: Publish
working-directory: npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}