Node workflow - build linux arm64 in a container (#520)

Co-authored-by: acalcutt <acalcutt@worcester.edu>
This commit is contained in:
Andrew Calcutt
2022-12-09 15:05:11 -05:00
committed by GitHub
parent 07b047012a
commit a405d7a9b3
4 changed files with 136 additions and 7 deletions

View File

@@ -202,3 +202,37 @@ jobs:
if: github.ref != 'refs/heads/main'
run: |
npm pack --dry-run
test_linux_arm:
runs-on: macos-12-arm
name: test (ubuntu-20.04, arm64)
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Install dependencies macOS
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install docker docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create the docker build image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: build
push: false
load: true
- name: Run the docker build image and create node libs
run: docker run --rm -v $(pwd):/data build

View File

@@ -37,17 +37,14 @@ jobs:
node-version: 18
- name: npm version
id: npmversion
run: >-
echo "::set-output name=NPM_VERSION::$(
npm version ${{ github.event.inputs.version }} --preid pre --no-git-tag-version
)"
run: |
echo "NPM_VERSION=$(npm version ${{ github.event.inputs.version }} --preid pre --no-git-tag-version)" >> $GITHUB_ENV
- name: Push version to git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git commit -a -m "Update node version to ${{ steps.npmversion.outputs.NPM_VERSION }} (${{ github.event.inputs.version }})"
git commit -a -m "Update node version to ${{ env.NPM_VERSION }} (${{ github.event.inputs.version }})"
git push
publish_binaries:
@@ -239,4 +236,55 @@ jobs:
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --tag next --access public
env:
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
publish_binary_linux_arm64:
runs-on: macos-12-arm
needs: bump_version
name: publish_binary (ubuntu-20.04, arm64)
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Install dependencies macOS
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install docker docker-compose
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create the docker build image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/arm64
file: platform/node/scripts/Dockerfile_Build
tags: build
push: false
load: true
- name: Run the docker build image and create node libs
run: docker run --rm -v $(pwd):/data build
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: npm ci
run: npm ci --ignore-scripts
- name: Publish ARM Release to Github
env:
PUBLISH: true
BUILDTYPE: RelWithDebInfo
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.NODE_PRE_GYP_GITHUB_TOKEN }}
run: |
./platform/node/scripts/publish.sh --target_arch=arm64