From b60fa136131a564e46647a7497c56f0190d00c88 Mon Sep 17 00:00:00 2001 From: Christian Cremer Date: Wed, 18 Sep 2024 22:50:41 +0200 Subject: [PATCH] Update CI workflows --- .github/workflows/build.yml | 5 +---- .github/workflows/lint.yml | 5 +---- .github/workflows/release.yml | 7 ++----- .github/workflows/test.yml | 14 +------------- .goreleaser.yml | 1 + .sync.yml | 4 ---- README.adoc | 4 +--- 7 files changed, 7 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bd5cbf..5d18c2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV - - uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - uses: actions/cache@v4 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4195012..aeda8c9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,12 +12,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV - - uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0bba53..988a501 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,9 @@ jobs: with: fetch-depth: 0 - - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV - - uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -62,7 +59,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish releases - uses: goreleaser/goreleaser-action@v5 + uses: goreleaser/goreleaser-action@v6 with: args: release --release-notes .github/release-notes.md env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ec47ff..3b56199 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,12 +17,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV - - uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - uses: actions/cache@v4 with: @@ -33,12 +30,3 @@ jobs: - name: Run tests run: make test - - - name: Upload code coverage report to Code Climate - uses: paambaati/codeclimate-action@v4.0.0 - env: - CC_TEST_REPORTER_ID: 38a41dde51e26878e774848c2654bba1082ad39703571505e877575b2a9695e3 - with: - coverageLocations: cover.out:gocov - prefix: github.com/${{ github.repository }} - diff --git a/.goreleaser.yml b/.goreleaser.yml index f75284e..281e5d8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,6 @@ # This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com +version: 2 builds: - env: - CGO_ENABLED=0 # this is needed otherwise the Docker image build is faulty diff --git a/.sync.yml b/.sync.yml index 97186cf..07f35ab 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,6 +1,2 @@ # This is the config file for greposync that defines default values # Visit the documentation at https://ccremer.github.io/greposync - -.github/workflows/test.yml: - codeclimate: - reporterID: 38a41dde51e26878e774848c2654bba1082ad39703571505e877575b2a9695e3 diff --git a/README.adoc b/README.adoc index 2dadaf6..3d47cc4 100644 --- a/README.adoc +++ b/README.adoc @@ -13,8 +13,6 @@ endif::[] ifdef::status[] image:https://img.shields.io/github/workflow/status/ccremer/fronius-exporter/Build/master[Build,link=https://github.com/ccremer/fronius-exporter/actions?query=workflow%3ABuild] -image:https://img.shields.io/codeclimate/maintainability/ccremer/fronius-exporter[Maintainability,link=https://codeclimate.com/github/ccremer/fronius-exporter] -image:https://img.shields.io/codeclimate/coverage/ccremer/fronius-exporter[Tests,link=https://codeclimate.com/github/ccremer/fronius-exporter] image:https://img.shields.io/github/v/release/ccremer/fronius-exporter[Releases,link=https://github.com/ccremer/fronius-exporter/releases] image:https://img.shields.io/github/license/ccremer/fronius-exporter[License,link=https://github.com/ccremer/fronius-exporter/blob/master/LICENSE] endif::[] @@ -106,7 +104,7 @@ Platform related builds are handled by `goreleaser`: export GOOS=linux export GOARCH=arm64 export IMAGE_REPOSITORY=ccremer/fronius-exporter -goreleaser build --snapshot --rm-dist --single-target +goreleaser build --snapshot --clean --single-target ---- On the other hand you can also use the actual `make build` in combination with `docker buildx`