From c259cedc4a264855679f4ef9fa0423ccac15bbef Mon Sep 17 00:00:00 2001 From: John Wregglesworth Date: Fri, 15 Apr 2022 14:06:30 -0700 Subject: [PATCH] Add release job to the GH action workflow --- .github/workflows/golang.yml | 49 +++++++++++++++++++++++++++++ .github/workflows/golangci-lint.yml | 38 ---------------------- 2 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/golang.yml delete mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golang.yml b/.github/workflows/golang.yml new file mode 100644 index 0000000..69eaa16 --- /dev/null +++ b/.github/workflows/golang.yml @@ -0,0 +1,49 @@ +name: Go + +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: latest + + release: + if: startsWith(github.ref, 'refs/tags/') + name: cut release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: latest + + - uses: actions/setup-go@v3 + with: + go-version: '1.18' + check-latest: true + + - name: Build + run: go build . + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + road-runner diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index d1d10c0..0000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: golangci-lint -on: - push: - tags: - - v* - branches: - - master - - main - pull_request: -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest - - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true - - # Optional: if set to true then the action will use pre-installed Go. - # skip-go-installation: true - - # Optional: if set to true then the action don't cache or restore ~/go/pkg. - # skip-pkg-cache: true - - # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. - # skip-build-cache: true