new-build #16
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
name: new-build | |
on: workflow_dispatch | |
# push: | |
# tags: ['*'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
HUSKY: 0 | |
permissions: | |
contents: read | |
jobs: | |
build-linux: | |
name: Build linux versions | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.5.1 | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
# build each image inline so the matrix doesn't checkout, install, install each time. | |
- name: Build alpine | |
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/contrast-security-oss/alpine | |
- name: Build centos7 | |
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/contrast-security-oss/centos7 | |
- name: Build linux-arm64 | |
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/contrast-security-oss/linux-arm64 | |
# now upload what was built | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: prebuilds-linux | |
path: prebuilds/ | |
build-macos-windows: | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
build-group: darwin | |
- os: windows-latest | |
build-group: win32 | |
name: Build ${{ matrix.build-group }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.5.1 | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Build | |
run: npm run build:${{ matrix.build-group }} | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: prebuilds-${{ matrix.build-group }} | |
path: prebuilds/ | |
# release: | |
# needs: [build-linux, build-macos-windows] | |
# name: Release to npm | |
# runs-on: ubuntu-latest | |
# timeout-minutes: 5 | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Set up node | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: 22.5.1 | |
# registry-url: https://registry.npmjs.org | |
# - name: Install | |
# run: npm ci --ignore-scripts | |
# - name: Download artifacts | |
# uses: actions/download-artifact@v4 | |
# with: | |
# pattern: prebuilds-* | |
# path: prebuilds/ | |
# merge-multiple: true | |
# - name: Publish to npm | |
# run: npm publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |