Skip to content

Commit

Permalink
feat: add Darwin ARM64 prebuild (#48)
Browse files Browse the repository at this point in the history
Also switch to using semantic releases.
  • Loading branch information
mtth authored Jun 1, 2024
1 parent 426db2a commit 4a04e83
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 30 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ jobs:
name: Test
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
tagged: ${{ format(steps.check-version.outputs.exists == 'false') }}
new-version: ${{ steps.bump-version.outputs.new_version }}
steps:
- name: Check out
uses: actions/checkout@v4
Expand Down Expand Up @@ -42,31 +44,16 @@ jobs:
- name: Test
run: pnpm t
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: out/coverage
- name: Extract version
id: extract-version
run: |
version="$(node -p 'require("./package.json").version')"
echo "version=$version" >>"$GITHUB_OUTPUT"
- name: Check if tag exists
uses: mukunku/[email protected]
id: check-version
with:
tag: v${{ steps.extract-version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
if: steps.check-version.outputs.exists == 'false'
uses: pkgdeps/git-tag-action@v2
- name: Bump version and create tag
id: bump-version
uses: mathieudutour/[email protected]
with:
git_commit_sha: ${{ github.sha }}
git_tag_prefix: v
github_repo: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ steps.extract-version.outputs.version }}
default_bump: false
prebuild-native:
strategy:
matrix:
Expand All @@ -75,12 +62,13 @@ jobs:
os: ubuntu-22.04
- key: darwin-x64
os: macos-12
# TODO: darwin-arm64 (https://github.com/github/roadmap/issues/528)
- key: darwin-arm64
os: macos-14
name: Prebuild ${{ matrix.key }}
timeout-minutes: 25
runs-on: ${{ matrix.os }}
needs: test
if: needs.test.outputs.tagged == 'true'
if: needs.test.outputs.new-version != ''
steps:
- name: Check out
uses: actions/checkout@v4
Expand Down Expand Up @@ -131,7 +119,7 @@ jobs:
timeout-minutes: 90
runs-on: ubuntu-latest
needs: test
if: needs.test.outputs.tagged == 'true'
if: needs.test.outputs.new-version != ''
steps:
- name: Check out
uses: actions/checkout@v4
Expand Down Expand Up @@ -188,6 +176,7 @@ jobs:
name: Publish packages
timeout-minutes: 5
needs:
- test
- prebuild-native
- prebuild-docker
runs-on: ubuntu-latest
Expand Down Expand Up @@ -218,11 +207,13 @@ jobs:
mv out/prebuilds/*/* packages/highs-addon/prebuilds
ls packages/highs-addon/prebuilds
- name: Point to NPM registry
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Publish
run: pnpm -r exec pnpm publish
run: |
pnpm -r exec pnpm version ${{ needs.test.outputs.new-version }}
pnpm -r exec pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins:
- - '@semantic-release/commit-analyzer'
- preset: conventionalcommits
parserOpts:
breakingHeaderPattern: ''
headerPattern: '/^(\w*)(?:\\((.*)\\))?!?: (.*)$/'
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "highs-packages",
"version": "0.6.6",
"version": "0.0.0",
"private": true,
"repository": "github:opvious/highs.ts",
"author": "Opvious Engineering <[email protected]>",
"license": "Apache-2.0",
"scripts": {
"bump": "pnpm -r --include-workspace-root exec npm version ${BUMP:-patch}",
"clean": "pnpm -r -F !. run clean && rm -rf node_modules out",
"fix": "prettier --write 'packages/*/*.ts' 'packages/*/{src,test}/**/*.ts' && pnpm run lint --fix",
"lint": "eslint 'packages/*/*.ts' 'packages/*/{src,test}/**/*.ts'",
Expand Down
1 change: 1 addition & 0 deletions packages/highs-addon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This package ships with pre-built binaries for several common environments:
| Platform | Architecture | C library |
| --- | --- | --- |
| `darwin` | `x64` | n/a |
| `darwin` | `arm64` | n/a |
| `linux` | `x64` | `glibc` |
| `linux` | `x64` | `musl` |
| `linux` | `arm64` | `glibc` |
Expand Down
2 changes: 1 addition & 1 deletion packages/highs-addon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "highs-addon",
"version": "0.6.6",
"version": "0.0.0",
"repository": "github:opvious/highs.ts",
"description": "Low-level Node.js binding for the HiGHS optimization solver",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/highs-solver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "highs-solver",
"version": "0.6.6",
"version": "0.0.0",
"repository": "github:opvious/highs.ts",
"description": "Node.js binding for the HiGHS optimization solver",
"keywords": [
Expand Down

0 comments on commit 4a04e83

Please sign in to comment.