From b18424dd1523b7480e4bb3c7e12fe79fa9b58b90 Mon Sep 17 00:00:00 2001 From: vol Date: Fri, 8 Dec 2023 20:32:52 +0200 Subject: [PATCH 1/3] Add pr workflow --- .github/workflows/pr.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..a9a7cec --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,30 @@ +name: Pull request workflow + +on: + pull_request: + branches: [ main ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Lint Go code + uses: golangci/golangci-lint-action@v3 + with: + version: latest + + - name: Run Go tests + run: go test ./... + + - name: Build + run: go build ./... \ No newline at end of file From ff6eab79beceaae311b8fd3bacd3069cbf86c650 Mon Sep 17 00:00:00 2001 From: vol Date: Fri, 8 Dec 2023 20:38:57 +0200 Subject: [PATCH 2/3] upd --- .github/workflows/pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a9a7cec..a927bac 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -21,7 +21,8 @@ jobs: - name: Lint Go code uses: golangci/golangci-lint-action@v3 with: - version: latest + version: v1.54 + args: --timeout=5m - name: Run Go tests run: go test ./... From 83bcf84393a9fa1f153e490019ff92704b353a87 Mon Sep 17 00:00:00 2001 From: vol Date: Fri, 8 Dec 2023 20:42:34 +0200 Subject: [PATCH 3/3] add release wf --- .github/workflows/release.yaml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..46b76c6 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +name: Go Release Workflow + +on: + release: + types: [created] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Lint Go code + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + args: --timeout=5m + + - name: Run Go tests + run: go test ./... + + - name: Build + run: go build ./... + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.PAT }} \ No newline at end of file