-
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.
Add build and release gh actions workflow
- Loading branch information
1 parent
910681e
commit 5b50c9e
Showing
3 changed files
with
68 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,49 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- aa/initial-setup # TODO: remove this after testing workflow | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Build CLI | ||
run: | | ||
go build -o cocli main.go | ||
# Add any additional build steps if needed | ||
- name: Set Tag Name | ||
id: set_tag_name | ||
run: echo "TAG_NAME=$(cat cocli_version.txt)" >> $GITHUB_ENV | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: v${{ env.TAG_NAME }} | ||
release_name: Release v${{ env.TAG_NAME }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./cocli | ||
asset_name: cocli | ||
asset_content_type: application/octet-stream | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
0.0.1 |
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