From 4e620e8a7514bfb9a584efd54b714c6db5bb7f21 Mon Sep 17 00:00:00 2001 From: Sean Rester Date: Fri, 12 Nov 2021 19:16:24 -0500 Subject: [PATCH] Adding standalone trigger for regression testing --- .github/workflows/release.yaml | 960 ++++++++++++++++----------------- 1 file changed, 480 insertions(+), 480 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3270159864..b22ace826f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,478 +6,478 @@ on: - "v*.*.*" jobs: - generate-schema: - runs-on: ubuntu-18.04 - container: - image: schemahero/schemahero:0.12.2 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Generate fixtures - run: | - /schemahero fixtures \ - --input-dir ./migrations/tables \ - --output-dir ./migrations/fixtures/schema \ - --dbname ship-cloud --driver postgres - - - name: Upload schema artifact - uses: actions/upload-artifact@v2 - with: - name: schema - path: ./migrations/fixtures/schema/fixtures.sql - - - generate-fixtures: - runs-on: ubuntu-18.04 - needs: [generate-schema] - container: - image: replicated/gitops-builder:buildkite - options: --user root - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Download schema artifact - uses: actions/download-artifact@v2 - with: - name: schema - path: ./migrations/fixtures/schema - - - name: Build fixtures - run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C migrations/fixtures deps build run - shell: bash - - - name: Upload fixtures artifact - uses: actions/upload-artifact@v2 - with: - name: fixtures - path: ./migrations/fixtures/fixtures.sql - - - publish-fixtures: - runs-on: ubuntu-18.04 - needs: [generate-fixtures] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: azure/docker-login@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Download fixtures artifact - uses: actions/download-artifact@v2 - with: - name: fixtures - path: ./migrations/fixtures - - - build-schema-migrations: - runs-on: ubuntu-20.04 - needs: [publish-fixtures] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: azure/docker-login@v1 - env: - DOCKER_CONFIG: ./migrations/.docker - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: "Release schema migrations on tag" - env: - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - DOCKER_CONFIG: ./.docker - run: | - export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C migrations schema-release - - - name: Upload airgap image - uses: actions/upload-artifact@v2 - with: - name: migrations-image - path: ./migrations/bin/docker-archive - - - test_web: - runs-on: ubuntu-18.04 - needs: [build-schema-migrations] - container: - image: replicated/gitops-builder:buildkite - options: --user root - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: '10' - - - name: Install cross-env - run: npm i -g cross-env - shell: bash - - # - name: Test web - # env: - # PACT_BROKER_USERNAME: ${{ secrets.PACT_BROKER_USERNAME }} - # PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }} - # run: | - # make -C kotsadm/web deps test publish-pact - - # TODO: migrate retry logic for pacts - # retry: - # automatic: - # # this command exiting with status 2 typically means that the yarn package failed to download - # - exit_status: 2 - # limit: 5 - - - build_web: - runs-on: ubuntu-18.04 - needs: [build-schema-migrations] - container: - image: replicated/gitops-builder:buildkite - options: --user root - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: '10' - - - name: Build web - env: - GIT_COMMIT: ${{ github.sha }} - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C web deps build-kotsadm - shell: bash - ## TODO: retry logic - # retry: - # automatic: - # # this command exiting with status 2 typically means that the yarn package failed to download - # - exit_status: 2 - # limit: 5 - - - name: Upload web artifact - uses: actions/upload-artifact@v2 - with: - name: web - path: ./web/dist - - - build_kurl_proxy: - runs-on: ubuntu-18.04 - needs: [build-schema-migrations] - container: - image: replicated/gitops-builder:buildkite-go14-node10 - options: --user root - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '^1.16.3' - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Build kurl_proxy - env: - GIT_COMMIT: ${{ github.sha }} - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - SCOPE_DSN_PUBLIC: "" - run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C kurl_proxy test build - shell: bash - - - name: Upload kurl_proxy artifact - uses: actions/upload-artifact@v2 - with: - name: kurl_proxy - path: ./kurl_proxy/bin - - - build_go_api: - runs-on: ubuntu-18.04 - needs: [test_web, build_web, build_kurl_proxy] - container: - image: replicated/gitops-builder:buildkite-go14-node10 - options: --user root - steps: - - uses: actions/setup-go@v2 - with: - go-version: '^1.16.3' - - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Checkout - uses: actions/checkout@v1 # not @v2 because of: https://github.com/actions/checkout/issues/126 - - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Download web artifact - uses: actions/download-artifact@v2 - with: - name: web - path: ./web/dist - - - name: Build Go API - env: - GIT_COMMIT: ${{ github.sha }} - # GITHUB_SHA: ${{ github.sha }} - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - # GITHUB_REPOSITORY: - # GITHUB_WORKSPACE: - SCOPE_DSN_PUBLIC: "" - run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make test kotsadm - shell: bash - - - name: Upload Go API artifact - uses: actions/upload-artifact@v2 - with: - name: go_api - path: ./bin - - - release_go_api_tagged: - runs-on: ubuntu-20.04 - needs: [build_web, build_go_api] - steps: - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '^1.16.3' - - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Checkout - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Download go_api artifact - uses: actions/download-artifact@v2 - with: - name: go_api - path: ./bin - - - name: Add executable permissions - run: chmod a+x ./bin/kotsadm - - - uses: azure/docker-login@v1 - env: - DOCKER_CONFIG: ./.docker - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build tagged release - env: - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - DOCKER_CONFIG: ./.docker - run: | - export $(cat .image.env | sed 's/#.*//g' | xargs) && make build-release - - - name: Upload airgap image - uses: actions/upload-artifact@v2 - with: - name: kotsadm-image - path: ./bin/docker-archive - - - build_kurl_proxy_tagged: - runs-on: ubuntu-18.04 - needs: [build_kurl_proxy] - steps: - - uses: azure/docker-login@v1 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '^1.16.3' - - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Checkout - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Download kurl_proxy artifact - uses: actions/download-artifact@v2 - with: - name: kurl_proxy - path: ./kurl_proxy/bin - - - name: Add executable permissions - run: chmod a+x ./kurl_proxy/bin/kurl_proxy - - - name: Build tagged release - env: - GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} - run: | - export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C kurl_proxy build-release - - - goreleaser: - runs-on: ubuntu-18.04 - steps: - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Checkout - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - uses: actions/cache@v2 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Unshallow - run: git fetch --prune --unshallow - - - uses: actions/setup-go@v2 - with: - go-version: '^1.16.3' - - - run: sudo apt-get update -y - - run: sudo apt-get -qq -y install gnupg2 libdevmapper-dev libgpgme-dev libc6-dev-i386 btrfs-progs btrfs-tools pkg-config - - name: set previous release tag for goreleaser - shell: bash - run: | - export TAG=$(curl --silent "https://api.github.com/repos/replicatedhq/kots/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') - echo "GORELEASER_PREVIOUS_TAG=${TAG}" >> $GITHUB_ENV - - - uses: sigstore/cosign-installer@main - with: - cosign-release: 'v1.2.1' - - - name: Get Cosign Key - run: | - echo $COSIGN_KEY | base64 -d > ./cosign.key - env: - COSIGN_KEY: ${{secrets.COSIGN_KEY}} - - - name: Generate SBOM - run: | - make sbom - env: - COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: "v0.166.1" - args: release --rm-dist --config deploy/.goreleaser.yaml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - build_airgap: - runs-on: ubuntu-18.04 - needs: [release_go_api_tagged, goreleaser, build-schema-migrations] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get tags - id: get_tag - uses: ./actions/version-tag - - - name: Download migrations - uses: actions/download-artifact@v2 - with: - name: migrations-image - path: ./docker-archive - - - name: Download kotsadm image - uses: actions/download-artifact@v2 - with: - name: kotsadm-image - path: ./docker-archive - - - name: Get Release - id: get_release - uses: bruceadams/get-release@v1.2.3 # no v1 tag - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Make kotsadm airgap archive - run: | - tar czf ./kotsadm.tar.gz -C ./ ./docker-archive - - - name: Upload airgap bundle - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: https://uploads.github.com/repos/replicatedhq/kots/releases/${{ steps.get_release.outputs.id }}/assets?name=kotsadm.tar.gz - asset_path: ./kotsadm.tar.gz - asset_name: kotsadm.tar.gz - asset_content_type: application/gzip +# generate-schema: +# runs-on: ubuntu-18.04 +# container: +# image: schemahero/schemahero:0.12.2 +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Generate fixtures +# run: | +# /schemahero fixtures \ +# --input-dir ./migrations/tables \ +# --output-dir ./migrations/fixtures/schema \ +# --dbname ship-cloud --driver postgres +# +# - name: Upload schema artifact +# uses: actions/upload-artifact@v2 +# with: +# name: schema +# path: ./migrations/fixtures/schema/fixtures.sql +# +# +# generate-fixtures: +# runs-on: ubuntu-18.04 +# needs: [generate-schema] +# container: +# image: replicated/gitops-builder:buildkite +# options: --user root +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Download schema artifact +# uses: actions/download-artifact@v2 +# with: +# name: schema +# path: ./migrations/fixtures/schema +# +# - name: Build fixtures +# run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C migrations/fixtures deps build run +# shell: bash +# +# - name: Upload fixtures artifact +# uses: actions/upload-artifact@v2 +# with: +# name: fixtures +# path: ./migrations/fixtures/fixtures.sql +# +# +# publish-fixtures: +# runs-on: ubuntu-18.04 +# needs: [generate-fixtures] +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - uses: azure/docker-login@v1 +# with: +# username: ${{ secrets.DOCKERHUB_USER }} +# password: ${{ secrets.DOCKERHUB_PASSWORD }} +# +# - name: Download fixtures artifact +# uses: actions/download-artifact@v2 +# with: +# name: fixtures +# path: ./migrations/fixtures +# +# +# build-schema-migrations: +# runs-on: ubuntu-20.04 +# needs: [publish-fixtures] +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - uses: azure/docker-login@v1 +# env: +# DOCKER_CONFIG: ./migrations/.docker +# with: +# username: ${{ secrets.DOCKERHUB_USER }} +# password: ${{ secrets.DOCKERHUB_PASSWORD }} +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: "Release schema migrations on tag" +# env: +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# DOCKER_CONFIG: ./.docker +# run: | +# export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C migrations schema-release +# +# - name: Upload airgap image +# uses: actions/upload-artifact@v2 +# with: +# name: migrations-image +# path: ./migrations/bin/docker-archive +# +# +# test_web: +# runs-on: ubuntu-18.04 +# needs: [build-schema-migrations] +# container: +# image: replicated/gitops-builder:buildkite +# options: --user root +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Setup Node.js environment +# uses: actions/setup-node@v2 +# with: +# node-version: '10' +# +# - name: Install cross-env +# run: npm i -g cross-env +# shell: bash +# +# # - name: Test web +# # env: +# # PACT_BROKER_USERNAME: ${{ secrets.PACT_BROKER_USERNAME }} +# # PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }} +# # run: | +# # make -C kotsadm/web deps test publish-pact +# +# # TODO: migrate retry logic for pacts +# # retry: +# # automatic: +# # # this command exiting with status 2 typically means that the yarn package failed to download +# # - exit_status: 2 +# # limit: 5 +# +# +# build_web: +# runs-on: ubuntu-18.04 +# needs: [build-schema-migrations] +# container: +# image: replicated/gitops-builder:buildkite +# options: --user root +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Setup Node.js environment +# uses: actions/setup-node@v2 +# with: +# node-version: '10' +# +# - name: Build web +# env: +# GIT_COMMIT: ${{ github.sha }} +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C web deps build-kotsadm +# shell: bash +# ## TODO: retry logic +# # retry: +# # automatic: +# # # this command exiting with status 2 typically means that the yarn package failed to download +# # - exit_status: 2 +# # limit: 5 +# +# - name: Upload web artifact +# uses: actions/upload-artifact@v2 +# with: +# name: web +# path: ./web/dist +# +# +# build_kurl_proxy: +# runs-on: ubuntu-18.04 +# needs: [build-schema-migrations] +# container: +# image: replicated/gitops-builder:buildkite-go14-node10 +# options: --user root +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Setup Go +# uses: actions/setup-go@v2 +# with: +# go-version: '^1.16.3' +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Build kurl_proxy +# env: +# GIT_COMMIT: ${{ github.sha }} +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# SCOPE_DSN_PUBLIC: "" +# run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C kurl_proxy test build +# shell: bash +# +# - name: Upload kurl_proxy artifact +# uses: actions/upload-artifact@v2 +# with: +# name: kurl_proxy +# path: ./kurl_proxy/bin +# +# +# build_go_api: +# runs-on: ubuntu-18.04 +# needs: [test_web, build_web, build_kurl_proxy] +# container: +# image: replicated/gitops-builder:buildkite-go14-node10 +# options: --user root +# steps: +# - uses: actions/setup-go@v2 +# with: +# go-version: '^1.16.3' +# +# - id: go-cache-paths +# run: | +# echo "::set-output name=go-build::$(go env GOCACHE)" +# echo "::set-output name=go-mod::$(go env GOMODCACHE)" +# - name: Checkout +# uses: actions/checkout@v1 # not @v2 because of: https://github.com/actions/checkout/issues/126 +# +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-build }} +# key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-mod }} +# key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Download web artifact +# uses: actions/download-artifact@v2 +# with: +# name: web +# path: ./web/dist +# +# - name: Build Go API +# env: +# GIT_COMMIT: ${{ github.sha }} +# # GITHUB_SHA: ${{ github.sha }} +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# # GITHUB_REPOSITORY: +# # GITHUB_WORKSPACE: +# SCOPE_DSN_PUBLIC: "" +# run: export $(cat .image.env | sed 's/#.*//g' | xargs) && make test kotsadm +# shell: bash +# +# - name: Upload Go API artifact +# uses: actions/upload-artifact@v2 +# with: +# name: go_api +# path: ./bin +# +# +# release_go_api_tagged: +# runs-on: ubuntu-20.04 +# needs: [build_web, build_go_api] +# steps: +# - name: Setup Go +# uses: actions/setup-go@v2 +# with: +# go-version: '^1.16.3' +# +# - id: go-cache-paths +# run: | +# echo "::set-output name=go-build::$(go env GOCACHE)" +# echo "::set-output name=go-mod::$(go env GOMODCACHE)" +# - name: Checkout +# uses: actions/checkout@v2 +# +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-build }} +# key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-mod }} +# key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Download go_api artifact +# uses: actions/download-artifact@v2 +# with: +# name: go_api +# path: ./bin +# +# - name: Add executable permissions +# run: chmod a+x ./bin/kotsadm +# +# - uses: azure/docker-login@v1 +# env: +# DOCKER_CONFIG: ./.docker +# with: +# username: ${{ secrets.DOCKERHUB_USER }} +# password: ${{ secrets.DOCKERHUB_PASSWORD }} +# +# - name: Build tagged release +# env: +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# DOCKER_CONFIG: ./.docker +# run: | +# export $(cat .image.env | sed 's/#.*//g' | xargs) && make build-release +# +# - name: Upload airgap image +# uses: actions/upload-artifact@v2 +# with: +# name: kotsadm-image +# path: ./bin/docker-archive +# +# +# build_kurl_proxy_tagged: +# runs-on: ubuntu-18.04 +# needs: [build_kurl_proxy] +# steps: +# - uses: azure/docker-login@v1 +# with: +# username: ${{ secrets.DOCKERHUB_USER }} +# password: ${{ secrets.DOCKERHUB_PASSWORD }} +# +# - name: Setup Go +# uses: actions/setup-go@v2 +# with: +# go-version: '^1.16.3' +# +# - id: go-cache-paths +# run: | +# echo "::set-output name=go-build::$(go env GOCACHE)" +# echo "::set-output name=go-mod::$(go env GOMODCACHE)" +# - name: Checkout +# uses: actions/checkout@v2 +# +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-build }} +# key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-mod }} +# key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} +# +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Download kurl_proxy artifact +# uses: actions/download-artifact@v2 +# with: +# name: kurl_proxy +# path: ./kurl_proxy/bin +# +# - name: Add executable permissions +# run: chmod a+x ./kurl_proxy/bin/kurl_proxy +# +# - name: Build tagged release +# env: +# GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }} +# run: | +# export $(cat .image.env | sed 's/#.*//g' | xargs) && make -C kurl_proxy build-release +# +# +# goreleaser: +# runs-on: ubuntu-18.04 +# steps: +# - id: go-cache-paths +# run: | +# echo "::set-output name=go-build::$(go env GOCACHE)" +# echo "::set-output name=go-mod::$(go env GOMODCACHE)" +# +# - name: Checkout +# uses: actions/checkout@v2 +# +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-build }} +# key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} +# - uses: actions/cache@v2 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-mod }} +# key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} +# +# - name: Unshallow +# run: git fetch --prune --unshallow +# +# - uses: actions/setup-go@v2 +# with: +# go-version: '^1.16.3' +# +# - run: sudo apt-get update -y +# - run: sudo apt-get -qq -y install gnupg2 libdevmapper-dev libgpgme-dev libc6-dev-i386 btrfs-progs btrfs-tools pkg-config +# - name: set previous release tag for goreleaser +# shell: bash +# run: | +# export TAG=$(curl --silent "https://api.github.com/repos/replicatedhq/kots/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') +# echo "GORELEASER_PREVIOUS_TAG=${TAG}" >> $GITHUB_ENV +# +# - uses: sigstore/cosign-installer@main +# with: +# cosign-release: 'v1.2.1' +# +# - name: Get Cosign Key +# run: | +# echo $COSIGN_KEY | base64 -d > ./cosign.key +# env: +# COSIGN_KEY: ${{secrets.COSIGN_KEY}} +# +# - name: Generate SBOM +# run: | +# make sbom +# env: +# COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} +# +# - name: Run GoReleaser +# uses: goreleaser/goreleaser-action@v2 +# with: +# version: "v0.166.1" +# args: release --rm-dist --config deploy/.goreleaser.yaml +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# +# build_airgap: +# runs-on: ubuntu-18.04 +# needs: [release_go_api_tagged, goreleaser, build-schema-migrations] +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Get tags +# id: get_tag +# uses: ./actions/version-tag +# +# - name: Download migrations +# uses: actions/download-artifact@v2 +# with: +# name: migrations-image +# path: ./docker-archive +# +# - name: Download kotsadm image +# uses: actions/download-artifact@v2 +# with: +# name: kotsadm-image +# path: ./docker-archive +# +# - name: Get Release +# id: get_release +# uses: bruceadams/get-release@v1.2.3 # no v1 tag +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Make kotsadm airgap archive +# run: | +# tar czf ./kotsadm.tar.gz -C ./ ./docker-archive +# +# - name: Upload airgap bundle +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: https://uploads.github.com/repos/replicatedhq/kots/releases/${{ steps.get_release.outputs.id }}/assets?name=kotsadm.tar.gz +# asset_path: ./kotsadm.tar.gz +# asset_name: kotsadm.tar.gz +# asset_content_type: application/gzip copy_nightly: @@ -485,6 +485,8 @@ jobs: runs-on: ubuntu-18.04 needs: [build_airgap] steps: + - name: Checkout + uses: actions/checkout@v2 - name: Copy assets uses: ./actions/copy-assets env: @@ -493,14 +495,13 @@ jobs: srcReleaseTag: ${{ env.GITHUB_REF_NAME }} dstReleaseTag: "v0.0.0-nightly" - - name: Get latest tag - id: get_latest_tag - uses: pozetroninc/github-action-get-latest-release@master - with: - repository: ${{ github.repository }} - excludes: prerelease, draft - regression_test: + - name: Get latest tag + id: get_latest_tag + uses: pozetroninc/github-action-get-latest-release@master + with: + repository: ${{ github.repository }} + excludes: prerelease, draft if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-nightly') needs: copy_nightly name: Run regression testing @@ -589,7 +590,6 @@ jobs: runs-on: ubuntu-18.04 needs: [release_go_api_tagged, build_kurl_proxy_tagged] steps: - - name: Checkout uses: actions/checkout@v2