.github/workflows/publish.yml #5
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: | ||
- v* | ||
workflow_dispatch: | ||
jobs: | ||
# build: | ||
# # TODO: should we run the tests, or can we assume that a v* tag ought to | ||
# # get published? | ||
# name: build | ||
# strategy: | ||
# matrix: | ||
# node: [20] | ||
# os: | ||
# - name: darwin | ||
# architecture: arm64 | ||
# host: macos-14 | ||
# - name: linux | ||
# architecture: x86-64 | ||
# host: ubuntu-20.04 | ||
# env: | ||
# CC: clang | ||
# CXX: clang++ | ||
# npm_config_clang: 1 | ||
# GYP_DEFINES: use_obsolete_asm=true | ||
# runs-on: ${{ matrix.os.host }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# submodules: true | ||
# - uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: 20 | ||
# check-latest: true | ||
# - name: Prebuildify | ||
# run: | | ||
# [[ $(uname -o) == *Linux ]] && \ | ||
# sudo apt-get update && \ | ||
# sudo apt-get install -y software-properties-common git build-essential clang libssl-dev libkrb5-dev libc++-dev wget python3 | ||
# npm ci | ||
# npx prebuildify --napi --strip -t "$(node --version | tr -d 'v')" | ||
# - uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: prebuild-${{ runner.os }}-${{ runner.arch }} | ||
# path: prebuilds | ||
# retention-days: 14 | ||
cross-compile: | ||
name: "cross compile linux/arm" | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
- name: build linux arm | ||
run: | | ||
docker build --platform=linux/arm64 --tag nodegit-linux-arm64 -f scripts/Dockerfile.ubuntu . | ||
docker create --platform=linux/arm64 --name nodegit-linux-arm64 nodegit-linux-arm64 | ||
docker cp "nodegit-linux-arm64:/app/prebuilds" . | ||
# list what we've got | ||
- run: find prebuilds | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: prebuild-${{ linux }}-${{ arm64 }} | ||
Check failure on line 65 in .github/workflows/publish.yml GitHub Actions / .github/workflows/publish.ymlInvalid workflow file
|
||
path: ./prebuilds | ||
# https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
check-latest: true | ||
registry-url: "https://registry.npmjs.org" | ||
scope: "readme" | ||
- name: download built libraries | ||
id: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: prebuilds | ||
- name: copy libs | ||
run: | | ||
set -x | ||
find ${{ steps.download.outputs.download-path }} | ||
mv ${{ steps.download.outputs.download-path }}/*/* ./prebuilds | ||
find ./prebuilds | ||
- name: npm install | ||
run: npm ci | ||
- name: publish | ||
run: | | ||
(cat "$NPM_CONFIG_USERCONFIG" || true) && echo "token: ${NODE_AUTH_TOKEN:0:10}" && npm publish --provenance --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |