Koichi Shiraishi | 2e67318 | 2020-01-19 04:53:36 +0900 | [diff] [blame] | 1 | name: Release |
| 2 | |
| 3 | on: |
Koichi Shiraishi | d9ca690 | 2020-03-03 02:36:32 +0900 | [diff] [blame] | 4 | release: |
| 5 | types: [published] |
Koichi Shiraishi | 2e67318 | 2020-01-19 04:53:36 +0900 | [diff] [blame] | 6 | |
| 7 | jobs: |
| 8 | goreleaser: |
| 9 | runs-on: ubuntu-latest |
| 10 | steps: |
| 11 | - name: Checkout code |
| 12 | uses: actions/checkout@v2 |
| 13 | |
| 14 | - name: Unshallow # required for the changelog to work correctly. |
| 15 | run: git fetch --prune --unshallow |
| 16 | |
| 17 | - name: Run GoReleaser |
| 18 | uses: docker://goreleaser/goreleaser:latest |
| 19 | with: |
| 20 | args: release --rm-dist |
| 21 | env: |
| 22 | GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }} |
Koichi Shiraishi | d9ca690 | 2020-03-03 02:36:32 +0900 | [diff] [blame] | 23 | |
| 24 | docker: |
| 25 | name: docker |
| 26 | runs-on: ubuntu-latest |
| 27 | steps: |
| 28 | - name: Check out the repo |
| 29 | uses: actions/checkout@v2 |
| 30 | |
| 31 | - name: Set version environment |
| 32 | run: | |
| 33 | CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v}) |
| 34 | echo "CUE_VERSION=$CUE_VERSION" |
| 35 | echo "::set-env name=CUE_VERSION::$(echo $CUE_VERSION)" |
| 36 | |
| 37 | - name: Push to Docker Hub |
| 38 | uses: docker/build-push-action@v1 |
| 39 | env: |
| 40 | DOCKER_BUILDKIT: 1 |
| 41 | GOLANG_VERSION: 1.14 |
| 42 | CUE_VERSION: ${{ env.CUE_VERSION }} |
| 43 | with: |
| 44 | repository: cuelang/cue |
| 45 | username: ${{ secrets.DOCKER_USERNAME }} |
| 46 | password: ${{ secrets.DOCKER_PASSWORD }} |
| 47 | tags: ${{ env.CUE_VERSION }},latest |
| 48 | tag_with_ref: false |
| 49 | tag_with_sha: false |
| 50 | target: cue |
| 51 | always_pull: true |
Koichi Shiraishi | c24f394 | 2020-04-10 06:50:09 +0900 | [diff] [blame] | 52 | build_args: GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION }} |
Koichi Shiraishi | d9ca690 | 2020-03-03 02:36:32 +0900 | [diff] [blame] | 53 | add_git_labels: true |