Skip to content

chore: update to fluvio 0.11.8 (#461) #196

chore: update to fluvio 0.11.8 (#461)

chore: update to fluvio 0.11.8 (#461) #196

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
build_and_upload_artifacts:
name: Publish Using github
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: ["18.13"]
target: [x86_64-unknown-linux-gnu]
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v4
- name: Install Stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup target add ${{matrix.target}}
- uses: actions-rs/[email protected]
with:
crate: nj-cli
version: latest
use-tool-cache: true
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Build package
run: |
nj-cli build -o ./dist/${{matrix.target}} --release --target ${{matrix.target}}
- name: "Upload Artifact - ${{matrix.os}} for ${{matrix.target}}"
uses: actions/upload-artifact@v4
with:
name: ${{matrix.target}}
path: ./dist/${{matrix.target}}
retention-days: 5
publish-to-npm-with-artifacts:
runs-on: [macos-latest] # macos needed for lipo command
needs: [build_and_upload_artifacts]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ./dist/
- name: size of darwin file
run: |
du -hs dist/*
ls -R ./dist
mkdir -p ./dist/{linux,darwin}
- name: Build universal dylib for macos
run: |
ls -R
lipo ./dist/x86_64-apple-darwin/index.node ./dist/aarch64-apple-darwin/index.node -create -output ./dist/darwin/index.node
rm -r ./dist/x86_64-apple-darwin/ ./dist/aarch64-apple-darwin/
- name: Build universal dylib for linux
run: |
du -hs dist/*
mv ./dist/x86_64-unknown-linux-gnu/index.node ./dist/linux/index.node
rm -r ./dist/x86_64-unknown-linux-gnu
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"
- name: Publish
# if: github.event_name == 'workflow_dispatch'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }}
run: npm publish --access public
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: github.event_name == 'workflow_dispatch'
with:
files: ./dist/*