Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix macos release #1807

Merged
merged 10 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions .github/workflows/build-release-manual-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'
working-directory: './javascript'
- run: npm install
working-directory: "./javascript"
- run: npm run build
Expand All @@ -36,7 +35,12 @@ jobs:
build_release_for_mac:
name: build_release_for_mac
needs: build_release_for_linux
runs-on: macos-13 # x64
strategy:
matrix:
target:
- { runner: macos-13, arch: x64 }
- { runner: macos-14, arch: arm64 }
runs-on: ${{ matrix.target.runner }}
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -46,13 +50,29 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'
working-directory: './javascript'
- run: npm install && npm update
working-directory: "./javascript"
- run: npm run build
working-directory: "./javascript"
- run: npm run package:macos
- run: npm run package:macos:${{ matrix.target.arch }}
working-directory: "./javascript"
- name: Test if zombienet-mac runs
run: ./bins/zombienet-macos version
working-directory: "./javascript"
run: ./bins/zombienet-macos-${{ matrix.target.arch }} version
working-directory: "./javascript"

# uncomment to upload the artifacts to the latest release
# - name: Gets latest created release info
# id: latest_release_info
# #uses: jossef/action-latest-release-info@v1.2.1
# uses: pepoviola/action-latest-release-info@v0.0.2
# env:
# GITHUB_TOKEN: ${{ github.token }}
# - name: upload macos artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
# asset_path: ./javascript/bins/zombienet-macos-${{ matrix.target.arch }}
# asset_name: zombienet-macos-${{ matrix.target.arch }}
# asset_content_type: application/octet-stream
10 changes: 4 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'
working-directory: './javascript'
- run: npm install
working-directory: "./javascript"
- run: npm run build
Expand Down Expand Up @@ -74,7 +73,7 @@ jobs:
strategy:
matrix:
target:
- { runner: macos-13, arch: x86_64 }
- { runner: macos-13, arch: x64 }
- { runner: macos-14, arch: arm64 }
runs-on: ${{ matrix.target.runner }}
steps:
Expand All @@ -86,22 +85,21 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18'
working-directory: './javascript'
- run: npm install && npm update
working-directory: "./javascript"
- run: npm run build
working-directory: "./javascript"
- run: npm run package:macos
- run: npm run package:macos:${{ matrix.target.arch }}
working-directory: "./javascript"
- name: Test if zombienet-mac runs
run: ./bins/zombienet-macos version
run: ./bins/zombienet-macos-${{ matrix.target.arch }} version
working-directory: "./javascript"
- name: upload macos artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.build_release_for_linux.outputs.upload_url }}
asset_path: ./javascript/bins/zombienet-macos
asset_path: ./javascript/bins/zombienet-macos-${{ matrix.target.arch }}
asset_name: zombienet-macos-${{ matrix.target.arch }}
asset_content_type: application/octet-stream
3 changes: 2 additions & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"lint:write": "eslint './**' --fix && npx prettier --write .",
"package": "npm run -w packages/cli package",
"package:linux": "npm run -w packages/cli package:linux",
"package:macos": "npm run -w packages/cli package:macos",
"package:macos:x64": "npm run -w packages/cli package:macos:x64",
"package:macos:arm64": "npm run -w packages/cli package:macos:arm64",
"zombie": "node ./packages/cli/dist/cli.js",
"test": "npm run test --workspaces --if-present",
"postinstall": "if [[ -f .husky/post-install.js ]]; then cd .. && node javascript/.husky/post-install.js; fi"
Expand Down
4 changes: 3 additions & 1 deletion javascript/packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"test": "echo \"Error: no test specified\"",
"package": "pkg . -o ../../bins/zombienet",
"package:linux": "pkg . -o ../../bins/zombienet-linux -t node18-linux-x64,node18-linux-arm64",
"package:macos": "pkg . -o ../../bins/zombienet-macos -t node18-macos-x64"
"package:macos:x64": "pkg . -o ../../bins/zombienet-macos-x64 -t node18-macos-x64",
"package:macos:arm64": "pkg . -o ../../bins/zombienet-macos-arm64 -t node18-macos-arm64"
},
"repository": {
"type": "git",
Expand All @@ -29,6 +30,7 @@
],
"targets": [
"node18-macos-x64",
"node18-macos-arm64",
"node18-linux-x64",
"node18-linux-arm64"
]
Expand Down
Loading