forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CICD] add github workflow to build and release aptos CLI
Closes: aptos-labs#1124
- Loading branch information
Showing
2 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# This defines a workflow to build and release a new version of the aptos CLI. | ||
# In order to trigger it go to the Actions Tab of the Repo, click "Release CLI" and then "Run Workflow". | ||
|
||
name: "Release CLI" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
type: string | ||
required: true | ||
description: "The release tag to create. E.g. `aptos-cli-v0.2.3` :" | ||
source_git_ref_override: | ||
type: string | ||
required: false | ||
description: "GIT_SHA1_OVERRIDE: Use this to override the Git SHA1, branch or tag to build the binaries from. Defaults to the workflow Git REV, but can be different than that:" | ||
|
||
jobs: | ||
build-linux-binary: | ||
name: "Build Linux binary" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.source_git_ref_override }} | ||
- name: Build CLI | ||
run: scripts/cli/build_cli_release.sh | ||
- name: Upload Binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cli-builds | ||
path: aptos-cli-*.zip | ||
|
||
build-os-x-binary: | ||
name: "Build OS X binary" | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.source_git_ref_override }} | ||
- name: Build CLI | ||
run: scripts/cli/build_cli_release.sh | ||
- name: Upload Binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cli-builds | ||
path: aptos-cli-*.zip | ||
|
||
release-binaries: | ||
name: "Release binaries" | ||
needs: | ||
- build-linux-binary | ||
- build-os-x-binary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download prebuilt binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: cli-builds | ||
|
||
- name: Create GitHub Release | ||
uses: "marvinpinto/[email protected]" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "${{ github.event.inputs.release_tag }}" | ||
prerelease: false | ||
files: | | ||
aptos-cli-*.zip |
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