ci: build and upload cli binary #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build npm package for jstz CLI | |
on: | |
# For manually rebuilding the images | |
pull_request: | |
jobs: | |
build-cli: | |
name: Build CLI | |
runs-on: [macos] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: nix --version | |
- name: Format | |
run: nix --accept-flake-config fmt -- --fail-on-change | |
- name: Prevent blst | |
run: nix --accept-flake-config develop -j auto --command sh -c '[ -z "$(cargo tree | grep blst)" ]' | |
- name: Build | |
run: nix --accept-flake-config --log-format raw -L build -j auto .#jstz_cli | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_name: huancheng-trili/test-cli | |
# A personal access token for the GitHub repository in which the release will be created and edited. | |
# It is recommended to create the access token with the following scopes: `repo, user, admin:repo_hook`. | |
repo_token: ${{ secrets.TEST_RELEASE }} | |
file: result/bin/jstz | |
asset_name: jstz | |
tag: ${{ github.event.pull_request.head.sha || github.sha }} | |
overwrite: true | |
body: "Test release" |