Skip to content

Include git metadata under formulation #2267

Include git metadata under formulation

Include git metadata under formulation #2267

Workflow file for this run

name: Node CI
on:
push:
branches:
- master
tags:
- 'v*'
workflow_dispatch:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '21.x']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build and test
run: |
npm install
npm run build --if-present
npm run lint
npm test
env:
CI: true
deno-build:
strategy:
matrix:
os: [windows, macos, ubuntu]
include:
- os: windows
build: |
deno compile --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid,osRelease --allow-write --allow-net --output cdxgenx.exe bin/cdxgen.js
.\cdxgenx.exe --help
(Get-FileHash .\cdxgenx.exe).hash | Out-File -FilePath .\cdxgenx.exe.sha256
artifact: cdxgenx.exe
- os: macos
build: |
deno compile --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid --allow-write --allow-net --target x86_64-apple-darwin --output cdxgenx-darwin-amd64 bin/cdxgen.js
./cdxgenx-darwin-amd64 --help
shasum -a 256 cdxgenx-darwin-amd64 > cdxgenx-darwin-amd64.sha256
deno compile --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid --allow-write --allow-net --target aarch64-apple-darwin --output cdxgenx-darwin-arm64 bin/cdxgen.js
shasum -a 256 cdxgenx-darwin-arm64 > cdxgenx-darwin-arm64.sha256
artifact: cdxgenx-darwin-amd64
- os: ubuntu
build: |
deno compile --allow-read --allow-env --allow-run --allow-sys=uid,systemMemoryInfo,gid --allow-write --allow-net --output cdxgenx bin/cdxgen.js
shasum -a 256 cdxgenx > cdxgenx.sha256
chmod + cdxgenx
./cdxgenx --help
artifact: cdxgenx
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: deno compile
run: |
deno lint
mkdir build
${{ matrix.build }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# ${{ matrix.artifact }}
# ${{ matrix.artifact }}.sha256
# cdxgenx-darwin-arm64
# cdxgenx-darwin-arm64.sha256
sae-builds:
strategy:
matrix:
os: [windows, macos, ubuntu]
include:
- os: windows
build: |
npx caxa --input . --output "cdxgen.exe" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/cdxgen.js"
.\cdxgen.exe --version
(Get-FileHash .\cdxgen.exe).hash | Out-File -FilePath .\cdxgen.exe.sha256
npm install --omit=optional
npx caxa --input . --exclude cdxgen.exe cdxgen.exe.sha256 --output "cdx-verify.exe" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/verify.js"
.\cdx-verify.exe --version
(Get-FileHash .\cdx-verify.exe).hash | Out-File -FilePath .\cdx-verify.exe.sha256
artifact: cdxgen.exe
vartifact: cdx-verify.exe
- os: macos
build: |
npx caxa --input . --output "cdxgen.app" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/cdxgen.js"
tar -czf "cdxgen.app.tgz" cdxgen.app
shasum -a 256 cdxgen.app.tgz > cdxgen.app.tgz.sha256
rm -rf node_modules
npm install --omit=optional
npx caxa --input . --exclude cdxgen.app cdxgen.app.tgz cdxgen.app.tgz.sha256 --output "cdx-verify.app" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/verify.js"
tar -czf "cdx-verify.app.tgz" cdx-verify.app
shasum -a 256 cdx-verify.app.tgz > cdx-verify.app.tgz.sha256
artifact: cdxgen.app.tgz
vartifact: cdx-verify.app.tgz
- os: ubuntu
build: |
npx caxa --input . --output "cdxgen" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/cdxgen.js"
chmod +x cdxgen
./cdxgen --version
sha256sum cdxgen > cdxgen.sha256
rm -rf node_modules
npm install --omit=optional
npx caxa --input . --exclude cdxgen cdxgen.sha256 --output "cdx-verify" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/verify.js"
chmod +x cdx-verify
./cdx-verify --version
sha256sum cdx-verify > cdx-verify.sha256
artifact: cdxgen
vartifact: cdx-verify
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '21.x'
- name: Produce sae
run: |
npm ci
${{ matrix.build }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.vartifact }}
path: ${{ matrix.vartifact }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ matrix.artifact }}
${{ matrix.artifact }}.sha256
${{ matrix.vartifact }}
${{ matrix.vartifact }}.sha256