this repo has no description
at master 94 lines 4.3 kB view raw
1# Code generated internal/ci/base/write.cue; DO NOT EDIT. 2 3name: Release 4concurrency: release 5"on": 6 push: 7 tags: 8 - v* 9 - '!*-0.dev' 10 branches: 11 - ci/test 12 - master 13 - release-branch.* 14jobs: 15 goreleaser: 16 defaults: 17 run: 18 shell: bash --noprofile --norc -euo pipefail {0} 19 runs-on: namespace-profile-linux-amd64-large 20 if: ${{github.repository == 'cue-lang/cue'}} 21 steps: 22 - name: Checkout code 23 uses: actions/checkout@v5 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@cbf8161ddb4e9b162409104954fb540e8a38c1da 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@v6 58 with: 59 cache: false 60 go-version: 1.25.6 61 - name: Set common go env vars 62 run: |- 63 case $(go env GOARCH) in 64 amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster 65 arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later 66 esac 67 68 # Dump env for good measure 69 go env 70 - name: Setup qemu 71 uses: docker/setup-qemu-action@v3 72 - name: Docker Login 73 uses: docker/login-action@v3 74 with: 75 registry: docker.io 76 username: cueckoo 77 password: ${{ secrets.CUECKOO_DOCKER_PAT }} 78 - run: go tool cue login --token=${{ secrets.NOTCUECKOO_CUE_TOKEN }} 79 - name: Install GoReleaser 80 uses: goreleaser/goreleaser-action@v6 81 with: 82 install-only: true 83 version: v2.13.3 84 - name: Run GoReleaser with CUE 85 env: 86 GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} 87 run: go tool cue cmd release 88 working-directory: ./internal/ci/goreleaser 89 - if: startsWith(github.ref, 'refs/tags/v') 90 name: Re-test cuelang.org 91 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' 92 - if: startsWith(github.ref, 'refs/tags/v') 93 name: Trigger unity build 94 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'