Skip to content

Add release CI workflow to build and release universal binary #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/tagged_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Create tagged release
on:
push:
tags:
- v*.*.*

jobs:
build:
strategy:
matrix:
arch: [ "x64", "arm64" ]
runs-on: macos-11
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: npm install --ignore-scripts
- name: Build
run: npm run build -- -a ${{matrix.arch}}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: permissions-${{matrix.arch}}
path: build/Release/permissions.node

deploy:
needs:
- build
runs-on: macos-11
steps:
- name: Set up Git repository
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install
run: npm install --ignore-scripts
- name: Create directories
run: |
mkdir -p build/Release
mkdir -p /tmp/artifacts/x64
mkdir -p /tmp/artifacts/arm64
- name: Download x64 artifact
uses: actions/download-artifact@v3
with:
name: permissions-x64
path: /tmp/artifacts/x64
- name: Download arm64 artifact
uses: actions/download-artifact@v3
with:
name: permissions-arm64
path: /tmp/artifacts/arm64
- name: Build universal binary
run: |
lipo /tmp/artifacts/x64/permissions.node /tmp/artifacts/arm64/permissions.node -create -output build/Release/permissions.node
lipo -info build/Release/permissions.node
- name: Publish tagged release
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}