diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..6e559b4 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,23 @@ +name: Go Check +on: [push, pull_request] +jobs: + check: + runs-on: ubuntu-latest + strategy: + matrix: + go: [1.20.x, 1.21.x, 1.22.x] + steps: + - name: Setup Go environment + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + stable: true + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: go get -v -t -d ./... + + - name: Test + run: go test ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..258eaea --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +on: + workflow_run: + workflows: ["Go Check"] + types: + - completed + branches: + - master + +jobs: + release: + + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v5 + with: + go-version: 1.22.x + stable: true + + - name: Get dependencies + run: go get -v -t -d ./... + + - name: Build + if: startsWith(github.ref, 'refs/tags/v') + run: | + TAG=$(git describe --tags --abbrev=0) + GIT_TAG=$TAG make clean build + + - name: Create release + if: startsWith(github.ref, 'refs/tags/v') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + files: build/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true + name: Release ${{ github.ref }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3fb6479..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: go -go: -- "1.18.x" - -notifications: - email: false - -script: -- go test ./... - -before_deploy: -- GIT_TAG=$TRAVIS_TAG make clean build - -deploy: -- provider: releases - api_key: $GH_TOKEN - file_glob: true - file: build/* - skip_cleanup: true - on: - tags: true