Skip to content

Commit

Permalink
darwin amd64 (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu authored Jan 31, 2024
1 parent 8ef915e commit 18bad14
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ jobs:
npm publish --access=public --@cyclonedx:registry='https://registry.npmjs.org'
popd
pushd packages/darwin-amd64
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/ppc64
echo "cyclonedx:registry=https://npm.pkg.github.com" > ~/.npmrc
npm publish --access=public --@cyclonedx:registry='https://npm.pkg.github.com'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
pushd packages/darwin-arm64
npm publish --dry-run
popd
pushd packages/darwin-amd64
npm publish --dry-run
popd
pushd packages/ppc64
npm publish --dry-run
popd
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ upx -9 --lzma ./plugins/cargo-auditable/cargo-auditable-cdxgen-linux-amd64
./plugins/cargo-auditable/cargo-auditable-cdxgen-linux-amd64
./plugins/dosai/dosai-linux-amd64 --help

for flavours in windows-amd64 linux-arm64 windows-arm64 darwin-arm64 ppc64
for flavours in windows-amd64 linux-arm64 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.5.5",
"version": "1.5.6",
"description": "Binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
25 changes: 25 additions & 0 deletions packages/darwin-amd64/build-darwin-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

rm -rf plugins/goversion
rm -rf plugins/trivy
rm -rf plugins/cargo-auditable
rm -rf plugins/osquery
rm -rf plugins/dosai
mkdir -p plugins/osquery plugins/dosai

wget https://github.com/osquery/osquery/releases/download/5.11.0/osquery-5.11.0_1.macos_x86_64.tar.gz
tar -xvf osquery-5.11.0_1.macos_x86_64.tar.gz
cp opt/osquery/bin/osqueryd plugins/osquery/osqueryi-macos-amd64
sha256sum plugins/osquery/osqueryi-macos-amd64 > plugins/osquery/osqueryi-macos-amd64.sha256
rm -rf etc usr var opt
rm osquery-5.11.0_1.macos_x86_64.tar.gz

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

for plug in goversion trivy cargo-auditable
do
mkdir -p plugins/$plug
mv ../../plugins/$plug/*darwin-amd64* plugins/$plug/
done
8 changes: 8 additions & 0 deletions packages/darwin-amd64/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/darwin-amd64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@cyclonedx/cdxgen-plugins-bin-darwin-amd64",
"version": "1.5.6",
"description": "Arm64 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 <prabhu@appthreat.com>",
"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": [
"darwin"
],
"cpu": [
"x64"
]
}
5 changes: 5 additions & 0 deletions packages/darwin-amd64/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
goversion/
trivy/
cargo-auditable/
osquery/
dosai/
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion packages/darwin-arm64/build-darwin-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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 -o plugins/dosai/dosai-darwin-arm64
curl -L https://github.com/owasp-dep-scan/dosai/releases/latest/download/Dosai-osx-arm64 -o plugins/dosai/dosai-darwin-arm64
chmod +x plugins/dosai/dosai-darwin-arm64
sha256sum plugins/dosai/dosai-darwin-arm64 > plugins/dosai/dosai-darwin-arm64.sha256

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.5.5",
"version": "1.5.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
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.5.5",
"version": "1.5.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.5.5",
"version": "1.5.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.5.5",
"version": "1.5.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.5.5",
"version": "1.5.6",
"description": "Arm64 binary plugins to supercharge @cyclonedx/cdxgen npm package",
"main": "index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/cargo-auditable/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build/linux_ppc64le: $(sources)
$(call sha,linux,ppc64le,)

##### DARWIN (MAC) BUILDS #####
darwin: build/darwin_arm64
darwin: build/darwin_amd64 build/darwin_arm64

build/darwin_amd64: $(sources)
$(call build,darwin,amd64,)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/goversion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build/linux_ppc64le: $(sources)
$(call sha,linux,ppc64le,)

##### DARWIN (MAC) BUILDS #####
darwin: build/darwin_arm64
darwin: build/darwin_amd64 build/darwin_arm64

build/darwin_amd64: $(sources)
$(call build,darwin,amd64,)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/trivy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build/linux_ppc64le: $(sources)
$(call sha,linux,ppc64le,)

##### DARWIN (MAC) BUILDS #####
darwin: build/darwin_arm64
darwin: build/darwin_amd64 build/darwin_arm64

build/darwin_amd64: $(sources)
$(call build,darwin,amd64,)
Expand Down

0 comments on commit 18bad14

Please sign in to comment.