mirror of
https://github.com/on4kjm/FLEcli.git
synced 2025-01-18 13:01:09 +01:00
review and fix build tooling (#85)
* Changes due to the Goreleaser upgrade * Get rid of GoReleaser warnings * Update "CI" GitHub action * Update "release" GitHub action
This commit is contained in:
parent
dd9b2ed05c
commit
2b48a80d8e
4 changed files with 34 additions and 24 deletions
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
|
@ -15,12 +15,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.15.2'
|
||||
go-version: '^1.19.5'
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Lint Go Code
|
||||
run: |
|
||||
|
@ -34,12 +34,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.15.2'
|
||||
go-version: '^1.19.5'
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run Unit tests.
|
||||
run: |
|
||||
|
@ -57,19 +57,21 @@ jobs:
|
|||
name: Build and Integration tests
|
||||
needs: [lint, test]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.17.2'
|
||||
go-version: '^1.19.5'
|
||||
- run: go mod download
|
||||
- name: Validates GO releaser config
|
||||
uses: goreleaser/goreleaser-action@master
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
distribution: goreleaser
|
||||
args: check
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@master
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
args: release --snapshot --skip-publish --rm-dist
|
||||
distribution: goreleaser
|
||||
args: release --snapshot --skip-publish --clean
|
||||
- name: Setup BATS
|
||||
run: test/install-bats.sh
|
||||
- name: Run End-To_end testing with the docker container
|
||||
|
|
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
@ -8,17 +8,18 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
name: goreleaser
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Login to DockerHub Registry
|
||||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
||||
- name: Unshallow Fetch
|
||||
run: git fetch --prune --unshallow
|
||||
- uses: actions/setup-go@v2
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '^1.17.2'
|
||||
go-version: '^1.19.5'
|
||||
- name: Release via goreleaser
|
||||
uses: goreleaser/goreleaser-action@master
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
distribution: goreleaser
|
||||
args: release --release-notes=doc/whats_new.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -18,6 +18,10 @@ builds:
|
|||
goarch: '386'
|
||||
- goos: windows
|
||||
goarch: amd64
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
|
||||
ldflags:
|
||||
- -s -w -X FLEcli/flecmd.version={{.Version}} -X FLEcli/flecmd.commit={{.Commit}} -X FLEcli/flecmd.date={{.Date}} -X=FLEcli/flecmd.builtBy=goReleaser
|
||||
|
@ -48,15 +52,18 @@ dockers:
|
|||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
|
||||
archives:
|
||||
- replacements:
|
||||
amd64: 64-bit
|
||||
386: 32-bit
|
||||
darwin: macOS
|
||||
linux: Linux
|
||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
- name_template: >-
|
||||
{{ .ProjectName }}_
|
||||
{{ .Version }}_
|
||||
{{- if eq .Os "darwin"}}macOS
|
||||
{{- else }}{{- .Os }}{{ end }}_
|
||||
{{- if eq .Arch "amd64" }}64-bit
|
||||
{{- else if eq .Arch "386" }}32-bit
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
rlcp: true
|
||||
files:
|
||||
- README.md
|
||||
- doc/whats_new.md
|
||||
|
|
4
Makefile
4
Makefile
|
@ -30,8 +30,8 @@ test-coverage: ## Run tests with coverage
|
|||
@cat cover.out >> coverage.txt
|
||||
|
||||
build: ## Build the binary file
|
||||
@goreleaser --snapshot --skip-publish --rm-dist
|
||||
@cp dist/FLEcli_darwin_amd64/FLEcli .
|
||||
@goreleaser --snapshot --skip-publish --clean
|
||||
@cp dist/FLEcli_darwin_amd64_v1/FLEcli .
|
||||
|
||||
clean: ## Remove previous build
|
||||
@rm -f ./FLEcli
|
||||
|
|
Loading…
Reference in a new issue