From 7bc2c58d195c31a9b6cbe03790714bc91d78026b Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Sat, 22 Jan 2022 17:09:30 +0100 Subject: [PATCH] Better CI pipeline --- .github/workflows/build.yml | 50 +++++-------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79140d0..93c6c18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,8 @@ name: build on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] workflow_dispatch: inputs: tag: @@ -12,50 +11,13 @@ on: required: true default: 'v0.0.0' +# See https://github.com/cristalhq/.github/.github/workflows jobs: - build: - name: Build & Test - runs-on: ubuntu-latest - - steps: - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.17 - - - name: Check out code - uses: actions/checkout@v2 - - - name: Download module dependencies - env: - GOPROXY: "https://proxy.golang.org" - run: go mod download - - - name: Test - run: go test -v -race -coverprofile=coverage.txt ./... - - - name: Upload Coverage - uses: codecov/codecov-action@v1 - continue-on-error: true - with: - token: ${{secrets.CODECOV_TOKEN}} - file: ./coverage.txt - fail_ci_if_error: false + uses: cristalhq/.github/.github/workflows/build.yml@main release: if: github.event_name == 'workflow_dispatch' - - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Checkout with tags - run: git fetch --prune --unshallow --tags - - - name: Create release - run: | - git log --format="%C(auto) %H %s" `git tag --sort=-committerdate | head -1`...HEAD > changelog.txt - echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token - gh release create ${{ github.event.inputs.tag }} -t ${{ github.event.inputs.tag }} -F changelog.txt + uses: cristalhq/.github/.github/workflows/release.yml@main + with: + tag: ${{ github.event.input.tag }}