Skip to content

Commit fb8bc69

Browse files
authored
Merge pull request #132 from dnorman3/master
Add workflow to publish kubectl-cycle binary
2 parents aeedd5f + 55bf9bc commit fb8bc69

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release Binaries
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*'
9+
workflow_dispatch:
10+
11+
env:
12+
PLUGIN_NAME: kubectl-cycle
13+
14+
jobs:
15+
build-and-release:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write # This is crucial for creating releases
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.22'
27+
28+
- name: Build for Linux (amd64)
29+
run: |
30+
GOOS=linux GOARCH=amd64 go build -o ${{ env.PLUGIN_NAME }}-linux-amd64 ./cmd/cli/main.go
31+
32+
- name: Build for Linux (arm64)
33+
run: |
34+
GOOS=linux GOARCH=arm64 go build -o ${{ env.PLUGIN_NAME }}-linux-arm64 ./cmd/cli/main.go
35+
36+
- name: Create/Update GitHub Release (for tags)
37+
if: startsWith(github.ref, 'refs/tags/')
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
tag_name: ${{ github.ref_name }}
41+
name: Release ${{ github.ref_name }}
42+
draft: false
43+
prerelease: false
44+
files: |
45+
${{ env.PLUGIN_NAME }}-linux-amd64
46+
${{ env.PLUGIN_NAME }}-linux-arm64
47+
48+
- name: Upload Artifacts (for master branch)
49+
if: github.ref == 'refs/heads/master'
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: kubectl-cycle-binaries-master
53+
path: |
54+
${{ env.PLUGIN_NAME }}-linux-amd64
55+
${{ env.PLUGIN_NAME }}-linux-arm64

0 commit comments

Comments
 (0)