From a039ae0aa256ba3f6bfe6b2c7fa9e67c590ce272 Mon Sep 17 00:00:00 2001 From: Ovidiu Miclea Date: Tue, 16 Jan 2024 16:11:08 +0200 Subject: [PATCH 1/4] Create master.yml --- .github/workflows/master.yml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/master.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..d843248 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,48 @@ +name: Build and Release + +on: + push: + branches: [ master ] + tags: [ '*.*.*' ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v2 + with: + go-version: '^1.17.0' + + - name: Test and create coverage + run: | + go test -race -shuffle=on -coverprofile=coverage.txt -covermode=atomic + + - name: Build + run: | + go build + + github-publish: + # Only publish if all other jobs succeed + needs: + - test + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v2 + with: + go-version: '^1.20.0' + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4a16cad449f909afb1a10486bc0364c6df67e855 Mon Sep 17 00:00:00 2001 From: Ovidiu Miclea Date: Tue, 16 Jan 2024 16:12:33 +0200 Subject: [PATCH 2/4] Update master.yml --- .github/workflows/master.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index d843248..bd3f134 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -19,15 +19,15 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '^1.17.0' + + - name: Build + run: | + go build - name: Test and create coverage run: | go test -race -shuffle=on -coverprofile=coverage.txt -covermode=atomic - - name: Build - run: | - go build - github-publish: # Only publish if all other jobs succeed needs: From cbd71189f36b1eeb520db10ba66d95b78fe19995 Mon Sep 17 00:00:00 2001 From: Ovidiu Miclea Date: Tue, 16 Jan 2024 16:14:03 +0200 Subject: [PATCH 3/4] Update master.yml --- .github/workflows/master.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index bd3f134..7019da1 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -19,6 +19,9 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '^1.17.0' + - name: Tidy + run: | + go mod tidy - name: Build run: | From 0955f2899ac7c658bbbb16212a9f98f471675bc4 Mon Sep 17 00:00:00 2001 From: Ovidiu Miclea Date: Tue, 16 Jan 2024 16:19:46 +0200 Subject: [PATCH 4/4] Update master.yml --- .github/workflows/master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 7019da1..5e6efdb 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -27,9 +27,9 @@ jobs: run: | go build - - name: Test and create coverage + - name: Test run: | - go test -race -shuffle=on -coverprofile=coverage.txt -covermode=atomic + go test -race -shuffle=on github-publish: # Only publish if all other jobs succeed