diff --git a/.github/workflows/build-integration.yml b/.github/workflows/build-integration.yml new file mode 100644 index 000000000..ec5adfaba --- /dev/null +++ b/.github/workflows/build-integration.yml @@ -0,0 +1,47 @@ +name: build-integration +on: + push: + branches: + - gocardless-v0.17.0+ + pull_request: + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.16 + cache: true + - name: Unit tests + run: make test + + + release: + if: contains('refs/heads/master', github.ref) + runs-on: ubuntu-latest + needs: + - unit-tests + permissions: + repository-projects: write + contents: write + id-token: write + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Release + run: | + curl -L -o /tmp/goreleaser_Linux_x86_64.tar.gz https://github.com/goreleaser/goreleaser/releases/download/v1.7.0/goreleaser_Linux_x86_64.tar.gz + tar zxf /tmp/goreleaser_Linux_x86_64.tar.gz -C /tmp + VERSION=$(cat VERSION) + TAG_VERSION="v${VERSION}" + if [[ $(git tag -l "${TAG_VERSION}") ]]; then + echo "::error:: Version ${TAG_VERSION} is already released" + exit 1 + fi + git tag "${TAG_VERSION}" + git push --tags + /tmp/goreleaser --rm-dist