Skip to content

Commit

Permalink
Arm32 package (#25)
Browse files Browse the repository at this point in the history
* Arm32 package

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Oct 25, 2024
1 parent 08c6c57 commit e17e361
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 36 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ jobs:
if: matrix.os == 'ubuntu-latest'
- uses: oras-project/setup-oras@v1
- run: oras version
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Release
run: |
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz
Expand Down Expand Up @@ -61,6 +53,13 @@ jobs:
npm publish --access=public --@cyclonedx:registry='https://registry.npmjs.org'
popd
pushd packages/linux-arm
echo "cyclonedx:registry=https://npm.pkg.github.com" > ~/.npmrc
npm publish --access=public --@cyclonedx:registry='https://npm.pkg.github.com'
echo "cyclonedx:registry=https://registry.npmjs.org" > ~/.npmrc
npm publish --access=public --@cyclonedx:registry='https://registry.npmjs.org'
popd
pushd packages/windows-arm64
echo "cyclonedx:registry=https://npm.pkg.github.com" > ~/.npmrc
npm publish --access=public --@cyclonedx:registry='https://npm.pkg.github.com'
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Build npm package

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pkg:
runs-on: ubuntu-latest
Expand All @@ -26,14 +28,6 @@ jobs:
if: matrix.os == 'ubuntu-latest'
- uses: oras-project/setup-oras@v1
- run: oras version
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Trim CI agent
run: |
chmod +x contrib/free_disk_space.sh
Expand All @@ -54,6 +48,9 @@ jobs:
pushd packages/linux-arm64
npm publish --dry-run
popd
pushd packages/linux-arm
npm publish --dry-run
popd
pushd packages/windows-arm64
npm publish --dry-run
popd
Expand Down Expand Up @@ -83,14 +80,6 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: |
.\build.ps1
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ upx -9 --lzma ./plugins/trivy/trivy-cdxgen-linux-amd64
./plugins/trivy/trivy-cdxgen-linux-amd64 -v
./plugins/dosai/dosai-linux-amd64 --help

for flavours in windows-amd64 linux-arm64 windows-arm64 darwin-arm64 darwin-amd64 ppc64
for flavours in windows-amd64 linux-arm64 linux-arm windows-arm64 darwin-arm64 darwin-amd64 ppc64
do
chmod +x packages/$flavours/build-$flavours.sh
pushd packages/$flavours
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin",
"version": "1.6.5",
"version": "1.6.6",
"description": "Binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/darwin-amd64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-darwin-amd64",
"version": "1.6.5",
"version": "1.6.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-darwin-arm64",
"version": "1.6.5",
"version": "1.6.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
17 changes: 17 additions & 0 deletions packages/linux-arm/build-linux-arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

rm -rf plugins/trivy
rm -rf plugins/osquery
rm -rf plugins/dosai
mkdir -p plugins/osquery plugins/dosai

curl -L https://github.com/owasp-dep-scan/dosai/releases/latest/download/Dosai-linux-arm -o plugins/dosai/dosai-linux-arm
chmod +x plugins/dosai/dosai-linux-arm
sha256sum plugins/dosai/dosai-linux-arm > plugins/dosai/dosai-linux-arm.sha256

for plug in trivy
do
mkdir -p plugins/$plug
mv ../../plugins/$plug/*linux-arm* plugins/$plug/
upx -9 --lzma plugins/$plug/*linux-arm* || true
done
8 changes: 8 additions & 0 deletions packages/linux-arm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Debug mode flag
const DEBUG_MODE =
process.env.CDXGEN_DEBUG_MODE === "debug" ||
process.env.NODE_ENV === "development";

if (DEBUG_MODE) {
console.log("cdxgen plugins check");
}
34 changes: 34 additions & 0 deletions packages/linux-arm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-arm",
"version": "1.6.6",
"description": "Arm binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/cyclonedx/cdxgen-plugins-bin.git"
},
"keywords": [
"cdxgen",
"sbom",
"bom",
"plugins",
"dependency",
"appsec"
],
"author": "Prabhu Subramanian <[email protected]>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/cyclonedx/cdxgen-plugins-bin/issues"
},
"homepage": "https://github.com/cyclonedx/cdxgen-plugins-bin#readme",
"files": [
"*.js",
"plugins/"
],
"os": [
"linux"
],
"cpu": [
"arm"
]
}
6 changes: 6 additions & 0 deletions packages/linux-arm/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
goversion/
trivy/
cargo-auditable/
osquery/
dosai/
sourcekitten/
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion packages/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-arm64",
"version": "1.6.5",
"version": "1.6.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ppc64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-ppc64",
"version": "1.6.5",
"version": "1.6.6",
"description": "ppc64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/windows-amd64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-windows-amd64",
"version": "1.6.5",
"version": "1.6.6",
"description": "Windows amd64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/windows-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-windows-arm64",
"version": "1.6.5",
"version": "1.6.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/trivy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ all: windows linux darwin
clean: rm -rf build/

##### LINUX BUILDS #####
linux: build/linux_amd64 build/linux_arm64 build/linux_ppc64le
linux: build/linux_amd64 build/linux_arm64 build/linux_arm build/linux_ppc64le

build/linux_386: $(sources)
$(call build,linux,386,)
Expand Down

0 comments on commit e17e361

Please sign in to comment.