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
pull/88/head
Jean-Marc MEESSEN 2 years ago committed by GitHub
parent dd9b2ed05c
commit 2b48a80d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: '^1.15.2' go-version: '^1.19.5'
- name: Check out code - name: Check out code
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Lint Go Code - name: Lint Go Code
run: | run: |
@ -34,12 +34,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: '^1.15.2' go-version: '^1.19.5'
- name: Check out code - name: Check out code
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Run Unit tests. - name: Run Unit tests.
run: | run: |
@ -57,19 +57,21 @@ jobs:
name: Build and Integration tests name: Build and Integration tests
needs: [lint, test] needs: [lint, test]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-go@v2 - uses: actions/setup-go@v3
with: with:
go-version: '^1.17.2' go-version: '^1.19.5'
- run: go mod download - run: go mod download
- name: Validates GO releaser config - name: Validates GO releaser config
uses: goreleaser/goreleaser-action@master uses: goreleaser/goreleaser-action@v4
with: with:
distribution: goreleaser
args: check args: check
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@master uses: goreleaser/goreleaser-action@v4
with: with:
args: release --snapshot --skip-publish --rm-dist distribution: goreleaser
args: release --snapshot --skip-publish --clean
- name: Setup BATS - name: Setup BATS
run: test/install-bats.sh run: test/install-bats.sh
- name: Run End-To_end testing with the docker container - name: Run End-To_end testing with the docker container

@ -8,17 +8,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: goreleaser name: goreleaser
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Login to DockerHub Registry - name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Unshallow Fetch - name: Unshallow Fetch
run: git fetch --prune --unshallow run: git fetch --prune --unshallow
- uses: actions/setup-go@v2 - uses: actions/setup-go@v3
with: with:
go-version: '^1.17.2' go-version: '^1.19.5'
- name: Release via goreleaser - name: Release via goreleaser
uses: goreleaser/goreleaser-action@master uses: goreleaser/goreleaser-action@v4
with: with:
distribution: goreleaser
args: release --release-notes=doc/whats_new.md args: release --release-notes=doc/whats_new.md
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@ -18,6 +18,10 @@ builds:
goarch: '386' goarch: '386'
- goos: windows - goos: windows
goarch: amd64 goarch: amd64
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
ldflags: ldflags:
- -s -w -X FLEcli/flecmd.version={{.Version}} -X FLEcli/flecmd.commit={{.Commit}} -X FLEcli/flecmd.date={{.Date}} -X=FLEcli/flecmd.builtBy=goReleaser - -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}}" - "--label=org.opencontainers.image.version={{.Version}}"
archives: archives:
- replacements: - name_template: >-
amd64: 64-bit {{ .ProjectName }}_
386: 32-bit {{ .Version }}_
darwin: macOS {{- if eq .Os "darwin"}}macOS
linux: Linux {{- else }}{{- .Os }}{{ end }}_
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" {{- if eq .Arch "amd64" }}64-bit
{{- else if eq .Arch "386" }}32-bit
{{- else }}{{ .Arch }}{{ end }}
format_overrides: format_overrides:
- goos: windows - goos: windows
format: zip format: zip
rlcp: true
files: files:
- README.md - README.md
- doc/whats_new.md - doc/whats_new.md

@ -30,8 +30,8 @@ test-coverage: ## Run tests with coverage
@cat cover.out >> coverage.txt @cat cover.out >> coverage.txt
build: ## Build the binary file build: ## Build the binary file
@goreleaser --snapshot --skip-publish --rm-dist @goreleaser --snapshot --skip-publish --clean
@cp dist/FLEcli_darwin_amd64/FLEcli . @cp dist/FLEcli_darwin_amd64_v1/FLEcli .
clean: ## Remove previous build clean: ## Remove previous build
@rm -f ./FLEcli @rm -f ./FLEcli

Loading…
Cancel
Save