github.com/cristalhq/base64@v0.1.2/.github/workflows/build.yml (about) 1 name: build 2 3 on: 4 push: 5 branches: [ main ] 6 pull_request: 7 branches: [ main ] 8 workflow_dispatch: 9 inputs: 10 tag: 11 description: 'Tag to create' 12 required: true 13 default: 'v0.0.0' 14 15 jobs: 16 17 build: 18 name: Build & Test 19 runs-on: ubuntu-latest 20 21 steps: 22 - name: Set up Go 1.x 23 uses: actions/setup-go@v2 24 with: 25 go-version: ^1.x 26 27 - name: Check out code 28 uses: actions/checkout@v2 29 30 - name: Test 31 run: go test -v -coverprofile=coverage.txt ./... 32 33 - name: Upload Coverage 34 uses: codecov/codecov-action@v1 35 continue-on-error: true 36 with: 37 token: ${{secrets.CODECOV_TOKEN}} 38 file: ./coverage.txt 39 fail_ci_if_error: false 40 41 release: 42 if: github.event_name == 'workflow_dispatch' 43 44 name: Release 45 runs-on: ubuntu-latest 46 steps: 47 - uses: actions/checkout@v2 48 49 - name: Checkout with tags 50 run: git fetch --prune --unshallow --tags 51 52 - name: Create release 53 run: | 54 git log --format="%C(auto) %H %s" `git tag --sort=-committerdate | head -1`...HEAD > changelog.txt 55 echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token 56 gh release create ${{ github.event.inputs.tag }} -F changelog.txt