Skip to content

release

release #141

Workflow file for this run

---
name: release
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
concurrency: main
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Gets latest created release info
id: release
uses: jossef/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- 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 .
- name: upload linux amd64 release binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpodctl-linux-amd64
asset_name: runpodctl-linux-amd64
asset_content_type: application/octet-stream
- name: upload darwin amd64 release binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpodctl-darwin-amd64
asset_name: runpodctl-darwin-amd64
asset_content_type: application/octet-stream
- name: upload darwin arm64 release binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpodctl-darwin-arm64
asset_name: runpodctl-darwin-arm64
asset_content_type: application/octet-stream
- name: upload windows amd64 release binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: bin/runpodctl-windows-amd64.exe
asset_name: runpodctl-windows-amd64.exe
asset_content_type: application/octet-stream
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
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