-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
40 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 |
---|---|---|
|
@@ -20,7 +20,6 @@ jobs: | |
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Gets latest created release info | ||
id: release | ||
uses: jossef/[email protected] | ||
|
@@ -29,12 +28,16 @@ jobs: | |
|
||
- name: build | ||
run: | | ||
env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-linux-amd64 . | ||
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-darwin-amd64 . | ||
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-darwin-arm64 . | ||
env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-windows-amd64.exe . | ||
# env GOOS=linux GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-linux-arm64 . | ||
# env GOOS=android GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-android-amd64 . | ||
echo '${{ steps.release.outputs.tag_name }}' > VERSION | ||
env GOOS=android GOARCH=amd64 go build -o bin/runpodctl-android-amd64 . | ||
env GOOS=darwin GOARCH=amd64 go build -o bin/runpodctl-darwin-amd64 . | ||
env GOOS=darwin GOARCH=arm64 go build -o bin/runpodctl-darwin-arm64 . | ||
env GOOS=linux GOARCH=amd64 go build -o bin/runpodctl-linux-amd64 . | ||
env GOOS=linux GOARCH=arm64 go build -o bin/runpodctl-linux-arm64 . | ||
env GOOS=windows GOARCH=amd64 go build -o bin/runpodctl-windows-amd64.exe . | ||
strip bin/* || true # strip the binary's DWARF debug info, where applicable | ||
./tools/upx --best bin/* || true # compress the binaries | ||
- name: upload linux amd64 release binary | ||
uses: actions/[email protected] | ||
|
@@ -83,21 +86,21 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} | ||
VERSION: ${{ steps.release.outputs.tag_name }} | ||
# - name: upload linux arm64 release binary | ||
# uses: actions/[email protected] | ||
# env: | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
# with: | ||
# upload_url: ${{ steps.release.outputs.upload_url }} | ||
# asset_path: bin/runpodctl-linux-arm64 | ||
# asset_name: runpodctl-linux-arm64 | ||
# asset_content_type: application/octet-stream | ||
# - name: upload android amd64 release binary | ||
# uses: actions/[email protected] | ||
# env: | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
# with: | ||
# upload_url: ${{ steps.release.outputs.upload_url }} | ||
# asset_path: bin/runpodctl-android-amd64 | ||
# asset_name: runpodctl-android-amd64 | ||
# asset_content_type: application/octet-stream | ||
- name: upload linux arm64 release binary | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
asset_path: bin/runpodctl-linux-arm64 | ||
asset_name: runpodctl-linux-arm64 | ||
asset_content_type: application/octet-stream | ||
- name: upload android amd64 release binary | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
asset_path: bin/runpodctl-android-amd64 | ||
asset_name: runpodctl-android-amd64 | ||
asset_content_type: application/octet-stream |
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 |
---|---|---|
|
@@ -15,4 +15,7 @@ | |
bin/ | ||
main | ||
.vscode/ | ||
vendor/ | ||
vendor/ | ||
|
||
## auto generated file during make and release | ||
version |
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
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 @@ | ||
${{ steps.release.outputs.tag_name }} |
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
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 |
---|---|---|
@@ -1,17 +1,33 @@ | ||
.PHONY: proto | ||
|
||
local: | ||
go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl . | ||
|
||
linux: | ||
env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl . | ||
mac: | ||
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl . | ||
windows: | ||
env GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl.exe . | ||
mac-amd64: | ||
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=1.0.0'" -o bin/runpodctl . | ||
local: version | ||
go build -ldflags -o bin/runpodctl . | ||
|
||
release: buildall strip compress | ||
|
||
lint: | ||
buildall: android-arm64 linux-amd64 darwin-arm64 windows-amd64 windows-arm64 darwin-amd64 | ||
|
||
compress: | ||
upx --best bin/* || true | ||
strip: | ||
strip bin/* || true | ||
|
||
|
||
android-arm64: version | ||
env GOOS=android GOARCH=arm64 go build -o bin/runpodctl-android-arm64 . | ||
linux-amd64: version | ||
env GOOS=linux GOARCH=amd64 go build -o bin/runpodctl-linux-amd64 . | ||
darwin-arm64: version | ||
env GOOS=darwin GOARCH=arm64 go build -o bin/runpodctl-darwin-arm64 . | ||
windows-amd64: version | ||
env GOOS=windows GOARCH=amd64 go build -o bin/runpodctl-windows-amd64.exe . | ||
windows-arm64: version | ||
env GOOS=windows GOARCH=arm64 go build -o bin/runpodctl-windows-arm64.exe . | ||
darwin-amd64: version | ||
env GOOS=darwin GOARCH=amd64 go build -o bin/runpodctl-darwin-amd64 . | ||
|
||
lint: version | ||
golangci-lint run | ||
version: | ||
echo "1.0.0-test" > VERSION |