cuelang.org/go@v0.10.1/.github/workflows/release.yml (about) 1 # Code generated internal/ci/ci_tool.cue; DO NOT EDIT. 2 3 name: Release 4 "on": 5 push: 6 tags: 7 - v* 8 - '!*-0.dev' 9 branches: 10 - ci/test 11 - master 12 - release-branch.* 13 concurrency: release 14 jobs: 15 goreleaser: 16 runs-on: ubuntu-22.04 17 defaults: 18 run: 19 shell: bash 20 if: ${{github.repository == 'cue-lang/cue'}} 21 steps: 22 - name: Checkout code 23 uses: actions/checkout@v4 24 with: 25 ref: ${{ github.event.pull_request.head.sha }} 26 fetch-depth: 0 27 - name: Reset git directory modification times 28 run: touch -t 202211302355 $(find * -type d) 29 - name: Restore git file modification times 30 uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe 31 - id: DispatchTrailer 32 name: Try to extract Dispatch-Trailer 33 run: |- 34 x="$(git log -1 --pretty='%(trailers:key=Dispatch-Trailer,valueonly)')" 35 if [[ "$x" == "" ]] 36 then 37 # Some steps rely on the presence or otherwise of the Dispatch-Trailer. 38 # We know that we don't have a Dispatch-Trailer in this situation, 39 # hence we use the JSON value null in order to represent that state. 40 # This means that GitHub expressions can determine whether a Dispatch-Trailer 41 # is present or not by checking whether the fromJSON() result of the 42 # output from this step is the JSON value null or not. 43 x=null 44 fi 45 echo "value<<EOD" >> $GITHUB_OUTPUT 46 echo "$x" >> $GITHUB_OUTPUT 47 echo "EOD" >> $GITHUB_OUTPUT 48 - if: |- 49 ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 50 Dispatch-Trailer: {"type":"')))) && (contains(github.event.head_commit.message, ' 51 Dispatch-Trailer: {"type":"')) 52 name: Check we don't have Dispatch-Trailer on a protected branch 53 run: |- 54 echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch" 55 false 56 - name: Install Go 57 uses: actions/setup-go@v5 58 with: 59 cache: false 60 go-version: 1.23.2 61 - name: Setup qemu 62 uses: docker/setup-qemu-action@v3 63 - name: Set up Docker Buildx 64 uses: docker/setup-buildx-action@v3 65 - name: Docker Login 66 uses: docker/login-action@v3 67 with: 68 registry: docker.io 69 username: cueckoo 70 password: ${{ secrets.CUECKOO_DOCKER_PAT }} 71 - name: Install CUE 72 run: go install ./cmd/cue 73 - name: Install GoReleaser 74 uses: goreleaser/goreleaser-action@v5 75 with: 76 install-only: true 77 version: v2.0.1 78 - name: Run GoReleaser with CUE 79 run: cue cmd release 80 working-directory: ./internal/ci/goreleaser 81 env: 82 GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} 83 - if: startsWith(github.ref, 'refs/tags/v') 84 name: Re-test cuelang.org 85 run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 86 - if: startsWith(github.ref, 'refs/tags/v') 87 name: Trigger unity build 88 run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Check against CUE ${GITHUB_REF##refs/tags/}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"${GITHUB_REF##refs/tags/}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches'