Skip to content

Commit

Permalink
add scripts to correct folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gvkhna committed May 28, 2024
1 parent d16f3a3 commit 9bc13a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
asdf reshim
make proto
goreleaser release --skip=publish --snapshot --clean
./scripts/create-main-npm-package.sh
ls dist/
# - name: Set up Go
Expand Down
2 changes: 1 addition & 1 deletion cli/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- arm64
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.
hooks:
post: .github/scripts/create-arch-npm-package.sh {{ .Os }} {{ .Arch }} {{ .Path }} {{ .Version }}
post: scripts/create-arch-npm-package.sh {{ .Os }} {{ .Arch }} {{ .Path }} {{ .Version }}

archives:
- format: tgz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ cp "${FULL_BINARY_PATH}" "${BIN_FOLDER}/"
# Create package.json
cat > "${PACKAGE_DIR}/package.json" <<EOF
{
"author": "Gaurav Khanna",
"cpu": ["${ARCH}"],
"name": "${PACKAGE_NAME}",
"version": "${VERSION}",
"os": ["${OS}"],
"cpu": ["${ARCH}"]
"repository": "github:gvkhna/warpdive",
"version": "${VERSION}"
}
EOF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Define base directories
SOURCE_DIR="warpdive"
TARGET_DIR="dist/npm/warpdive"
VERSION=$1

# Get the current Git tag
VERSION=$(git describe --tags --abbrev=0)

# Create necessary directories
mkdir -p "${TARGET_DIR}/bin/"
Expand All @@ -15,25 +17,26 @@ cp "${SOURCE_DIR}/install.js" "${TARGET_DIR}/"
# Create package.json
cat > "${TARGET_DIR}/package.json" <<EOF
{
"author": "Gaurav Khanna",
"description": "Warpdive is a docker/oci container layer browser. Learn more at warpdive.xyz.",
"keywords": ["warpdive", "cli"],
"name": "warpdive",
"version": "0.0.1",
"description": "Main package for Warpdive",
"repository": "github:gvkhna/warpdive",
"version": "${VERSION}",
"bin": {
"warpdive": "bin/cli"
},
"scripts": {
"postinstall": "node ./install.js"
},
"optionalDependencies": {
"warpdive-darwin-amd64": "0.0.1",
"warpdive-darwin-arm64": "0.0.1",
"warpdive-linux-amd64": "0.0.1",
"warpdive-linux-arm64": "0.0.1",
"warpdive-windows-amd64": "0.0.1",
"warpdive-windows-arm64": "0.0.1"
},
"keywords": ["warpdive", "cli"],
"author": "Gaurav Khanna"
"warpdive-darwin-amd64": "${VERSION}",
"warpdive-darwin-arm64": "${VERSION}",
"warpdive-linux-amd64": "${VERSION}",
"warpdive-linux-arm64": "${VERSION}",
"warpdive-windows-amd64": "${VERSION}",
"warpdive-windows-arm64": "${VERSION}"
}
}
EOF

Expand Down

0 comments on commit 9bc13a0

Please sign in to comment.