diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index d0bd927..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -open_collective: webhook diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 1829c7d..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75f347d..79ce1fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,23 +1,62 @@ -name: build -on: [push, pull_request] +name: Release + +on: + workflow_dispatch: + push: + branches: + - 'main' + tags: + - 'v*' +env: + GO_VERSION: 1.19 + jobs: build: - strategy: - matrix: - go-version: [1.14.x, 1.15.x] - os: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{ matrix.os }} - + runs-on: ubuntu-latest + env: + GO111MODULE: on + DOCKER_CLI_EXPERIMENTAL: "enabled" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - + name: Checkout + uses: actions/checkout@v3 with: - go-version: ${{ matrix.go-version }} - id: go - - - name: Build - run: go build -v - - - name: Test - run: go test -v ./... + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Cache Go modules + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - + name: Tests + run: | + go mod tidy + go test -v ./... + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + if: success() && startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file