Skip to content

Commit d3250ee

Browse files
Rename binary in goreleaser config #22
- Update gh workflows - Added workflows README - Update goreleaser config
1 parent 1ef75da commit d3250ee

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

.github/workflows/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Hub CTL Workflows
2+
3+
## go.yaml
4+
5+
The workflow runs operations: `go test` and `go build` for two OS (ubuntu and macOS). It triggers on each push that has changes related to `*.go` files and on created pull requests.
6+
7+
## release.yaml
8+
9+
The workflow is used to create a new release of Hub CTL. It triggers on creation of a new tag in [semver](https://semver.org/) format (ex. `v1.0.0`).
10+
11+
The release is created with help of the [GoReleaser] tool. The config file is located at the root of the repository. [GoReleaser] builds artifacts and creates GitHub release with them. Also, it updates the Formula for [brew](https://brew.sh/) installation of Hub CTL. Repository with Formula located [here](https://github.com/epam/homebrew-hubctl). To update the Formula, [GoReleaser] requires [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). It should be stored as repository secret under `HOMEBREW_TAP_GITHUB_TOKEN` name.
12+
13+
[GoReleaser]: https://goreleaser.com/

.github/workflows/go.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Tests
22
on:
33
push:
4-
branches:
5-
- "master"
64
paths:
75
- "*/**.go"
86
pull_request: {}

.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
3838
-
3939
name: Run GoReleaser
40-
uses: goreleaser/goreleaser-action@v3
40+
uses: goreleaser/goreleaser-action@v4
4141
with:
4242
distribution: goreleaser
4343
version: latest
44-
args: release --rm-dist
44+
args: release --clean
4545
env:
4646
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

.goreleaser.yaml

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project_name: hub
1+
project_name: hubctl
22

33
before:
44
hooks:
@@ -28,12 +28,12 @@ builds:
2828
- -X 'github.com/epam/hubctl/cmd/hub/util.buildAt={{ time "2006.01.02 15:04:05 MST" }}'
2929

3030
archives:
31-
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
32-
replacements:
33-
darwin: Darwin
34-
linux: Linux
35-
windows: Windows
36-
amd64: x86_64
31+
- name_template: >-
32+
{{ .ProjectName }}_
33+
{{- title .Os }}_
34+
{{- if eq .Arch "amd64" }}x86_64
35+
{{- else if eq .Arch "386" }}i386
36+
{{- else }}{{ .Arch }}{{ end }}
3737
format_overrides:
3838
- goos: windows
3939
format: zip
@@ -52,17 +52,17 @@ changelog:
5252
- "upd"
5353

5454
brews:
55-
- name: hub
55+
- name: hubctl
5656

5757
tap:
5858
owner: epam
59-
name: homebrew-tap
59+
name: homebrew-hubctl
6060
branch: main
6161
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
6262

6363
commit_author:
64-
name: epambot
65-
email: epambot@users.noreply.github.com
64+
name: therealspaceship
65+
email: therealspaceship@users.noreply.github.com
6666
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Version }}"
6767

6868
folder: Formula
@@ -73,10 +73,10 @@ brews:
7373
custom_block: |
7474
head "https://github.com/epam/hubctl"
7575
caveats: |
76-
hub version
77-
hub help
78-
hub elaborate hub.yaml params.yaml -o hub.yaml.elaborate
79-
hub deploy hub.yaml.elaborate -e NAME=stage
76+
hubctl version
77+
hubctl help
78+
hubctl elaborate hub.yaml params.yaml -o hub.yaml.elaborate
79+
hubctl deploy hub.yaml.elaborate -e NAME=stage
8080
8181
dependencies:
8282
- name: jq
@@ -85,12 +85,12 @@ brews:
8585
type: optional
8686

8787
test: |
88-
output = shell_output("#{bin}/hub version").chomp
88+
output = shell_output("#{bin}/hubctl version").chomp
8989
assert output.start_with?("Hub CTL git ")
9090
system "false"
9191
9292
post_install: |
9393
hub_home = Pathname.new "#{Dir.home}/.hub"
9494
unless hub_home.exist?
95-
system "#{Formula["hub"].opt_bin}/hub", "extensions", "install"
95+
system "#{Formula["hub"].opt_bin}/hubctl", "extensions", "install"
9696
end

0 commit comments

Comments
 (0)