-
Notifications
You must be signed in to change notification settings - Fork 38
129 lines (118 loc) · 4.87 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
name: release
on:
push:
branches:
- main
jobs:
release:
concurrency: main
name: release
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: go
package-name: runpodctl
pull-request-title-pattern: release${component} ${version}
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-go@v2
if: ${{ steps.release.outputs.release_created }}
with:
go-version: 1.17
- name: build
if: ${{ steps.release.outputs.release_created }}
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
if: ${{ steps.release.outputs.release_created }}
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
if: ${{ steps.release.outputs.release_created }}
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
if: ${{ steps.release.outputs.release_created }}
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
if: ${{ steps.release.outputs.release_created }}
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: upload linux arm64 release binary
# if: ${{ steps.release.outputs.release_created }}
# 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
# if: ${{ steps.release.outputs.release_created }}
# 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
brew:
runs-on: ubuntu-latest
needs: release
permissions:
contents: write
steps:
- name: Checkout
if: ${{ needs.release.outputs.release_created }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
if: ${{ needs.release.outputs.release_created }}
uses: actions/setup-go@v4
with:
go-version: 1.17
- name: Run GoReleaser
if: ${{ needs.release.outputs.release_created }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}