11name : release
2-
32on :
43 push :
54 branches :
65 - release/v*
7-
86env :
97 AWS_REGION : us-west-2
108 AWS_ROLE : arn:aws:iam::270074865685:role/terraform-module-ci-test
119 GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
1210 ALL_TESTS_JSON : ' ["TestOneBasic","TestThreeBasic","TestProductionBasic"]'
1311 NIX_INSTALL_SHA : de490f61fcbaf9a5cabf2fa621ddb9ef93ad35d9a23a04e7d51b26e092b63691
1412 NIX_INSTALL_VERSION : 2.34.4
15-
1613permissions :
1714 contents : write
1815 id-token : write
1916 issues : write
2017 pull-requests : write
2118 actions : read
22-
2319jobs :
2420 setup :
2521 runs-on : ubuntu-latest
3026 run : |
3127 JSON_LIST='${{env.ALL_TESTS_JSON}}'
3228 echo "tests=$JSON_LIST" >> "$GITHUB_OUTPUT"
33-
3429 release :
3530 runs-on : ubuntu-latest
3631 outputs :
6459 } catch (error) {
6560 core.setFailed(`Failed to create comment on release PR: ${error.message}`);
6661 }
67-
6862 # this creates a loop using workflow logic,
6963 # each iteration of the loop is in its own job
7064 # this is important because we want each iteration to be a separate VM
8175 runs-on : ubuntu-latest
8276 strategy :
8377 matrix :
84- attempts : [1,2, 3] # I want to have jobs specifically in place to retry or cancel a test based on IP collisions
78+ attempts : [1, 2, 3] # I want to have jobs specifically in place to retry or cancel a test based on IP collisions
8579 test_name : ${{ fromJSON(needs.setup.outputs.tests) }}
8680 steps :
8781 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 https://github.com/actions/checkout
@@ -234,7 +228,6 @@ jobs:
234228 const scriptPath = `${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/check-run.js`;
235229 const { default: script } = await import(scriptPath);
236230 await script({ process, github, core });
237-
238231 cleanup :
239232 needs :
240233 - setup
@@ -285,7 +278,6 @@ jobs:
285278 export AWS_MAX_ATTEMPTS="100"
286279 export AWS_RETRY_MODE="adaptive"
287280 ./run_tests.sh -c $IDENTIFIER
288-
289281 report :
290282 needs :
291283 - setup
@@ -326,7 +318,6 @@ jobs:
326318 } catch (error) {
327319 core.setFailed(`Failed to create comment failure on release PR: ${error.message}`);
328320 }
329-
330321 rc-release :
331322 needs :
332323 - setup
@@ -408,14 +399,58 @@ jobs:
408399
409400 echo "Importing gpg key"
410401 echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
402+ - name : Setup goreleaser
403+ shell : bash
404+ run : |-
405+ OS="Linux"
406+ if [[ ${RUNNER_OS} != "Linux" ]]; then
407+ echo "Unsupported OS: ${RUNNER_OS}"
408+ exit 1
409+ fi
410+
411+ # renovate-local: goreleaser-x86_64
412+ GORELEASER_VERSION="v2.15.2"
413+ # renovate-local: goreleaser-x86_64=v2.15.2
414+ GORELEASER_CHECKSUM_x86_64="0ebdbf0353aba566b969dde746cc4e4806f96c27aa2f3971b229a9df7611fedc"
415+
416+ ARCH=$(uname -m)
417+ CHECKSUM="${GORELEASER_CHECKSUM_x86_64}"
418+ if [[ "${ARCH}" != "x86_64" ]]; then
419+ echo "Unsupported architecture: ${ARCH}"
420+ exit 1
421+ fi
422+
423+ FILE="goreleaser_${OS}_${ARCH}.tar.gz"
424+
425+ echo "Installing ${FILE}"
426+ curl -LO "https://github.com/goreleaser/goreleaser/releases/download/${GORELEASER_VERSION}/${FILE}"
427+ echo "${CHECKSUM} ${FILE}" | sha256sum -c
428+ tar -xf "${FILE}" goreleaser
429+
430+ if sudo -n true &> /dev/null; then
431+ sudo install -m 755 goreleaser /usr/local/bin/goreleaser
432+ else
433+ install -m 755 goreleaser /usr/local/bin/goreleaser
434+ fi
435+ rm -f "${FILE}" goreleaser
411436 - name : Run GoReleaser
412- uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
413- with :
414- args : release --clean --config .goreleaser_rc.yml
415437 env :
416438 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
417439 GPG_KEY_ID : ${{ env.GPG_KEY_ID }}
418440 GPG_PASSPHRASE : ${{ env.GPG_PASSPHRASE }}
441+ shell : bash
442+ run : |-
443+ goreleaser release --clean --config .goreleaser_rc.yml
444+ if [[ ! -f dist/metadata.json ]] || [[ ! -s dist/metadata.json ]]; then
445+ echo "Missing required file: dist/metadata.json"
446+ exit 1
447+ fi
448+ if [[ ! -f dist/artifacts.json ]] || [[ ! -s dist/artifacts.json ]]; then
449+ echo "Missing required file: dist/artifacts.json"
450+ exit 1
451+ fi
452+ echo "metadata=$(tr -d '\n\r' < dist/metadata.json)" >> "${GITHUB_OUTPUT}"
453+ echo "artifacts=$(tr -d '\n\r' < dist/artifacts.json)" >> "${GITHUB_OUTPUT}"
419454 - name : ' Find Issues and Create Comments'
420455 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 https://github.com/actions/github-script
421456 env :
@@ -426,7 +461,6 @@ jobs:
426461 const scriptPath = `${{ github.workspace }}/.github/workflows/scripts/rc-notify.js`;
427462 const { default: script } = await import(scriptPath);
428463 await script({github, context, core, process});
429-
430464 # This runs after release-please generates a release, so when the release PR is merged
431465 publish :
432466 needs :
@@ -473,11 +507,55 @@ jobs:
473507
474508 echo "Importing gpg key"
475509 echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
510+ - name : Setup goreleaser
511+ shell : bash
512+ run : |-
513+ OS="Linux"
514+ if [[ ${RUNNER_OS} != "Linux" ]]; then
515+ echo "Unsupported OS: ${RUNNER_OS}"
516+ exit 1
517+ fi
518+
519+ # renovate-local: goreleaser-x86_64
520+ GORELEASER_VERSION="v2.15.2"
521+ # renovate-local: goreleaser-x86_64=v2.15.2
522+ GORELEASER_CHECKSUM_x86_64="0ebdbf0353aba566b969dde746cc4e4806f96c27aa2f3971b229a9df7611fedc"
523+
524+ ARCH=$(uname -m)
525+ CHECKSUM="${GORELEASER_CHECKSUM_x86_64}"
526+ if [[ "${ARCH}" != "x86_64" ]]; then
527+ echo "Unsupported architecture: ${ARCH}"
528+ exit 1
529+ fi
530+
531+ FILE="goreleaser_${OS}_${ARCH}.tar.gz"
532+
533+ echo "Installing ${FILE}"
534+ curl -LO "https://github.com/goreleaser/goreleaser/releases/download/${GORELEASER_VERSION}/${FILE}"
535+ echo "${CHECKSUM} ${FILE}" | sha256sum -c
536+ tar -xf "${FILE}" goreleaser
537+
538+ if sudo -n true &> /dev/null; then
539+ sudo install -m 755 goreleaser /usr/local/bin/goreleaser
540+ else
541+ install -m 755 goreleaser /usr/local/bin/goreleaser
542+ fi
543+ rm -f "${FILE}" goreleaser
476544 - name : Run GoReleaser
477- uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
478- with :
479- args : release --clean --config .goreleaser.yml
480545 env :
481546 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
482547 GPG_KEY_ID : ${{ env.GPG_KEY_ID }}
483548 GPG_PASSPHRASE : ${{ env.GPG_PASSPHRASE }}
549+ shell : bash
550+ run : |-
551+ goreleaser release --clean --config .goreleaser.yml
552+ if [[ ! -f dist/metadata.json ]] || [[ ! -s dist/metadata.json ]]; then
553+ echo "Missing required file: dist/metadata.json"
554+ exit 1
555+ fi
556+ if [[ ! -f dist/artifacts.json ]] || [[ ! -s dist/artifacts.json ]]; then
557+ echo "Missing required file: dist/artifacts.json"
558+ exit 1
559+ fi
560+ echo "metadata=$(tr -d '\n\r' < dist/metadata.json)" >> "${GITHUB_OUTPUT}"
561+ echo "artifacts=$(tr -d '\n\r' < dist/artifacts.json)" >> "${GITHUB_OUTPUT}"
0 commit comments