From c24e5bc08708eb71bdffba97863e5a5612ccdd3b Mon Sep 17 00:00:00 2001 From: Daniel Pacak Date: Fri, 10 Dec 2021 16:41:47 +0100 Subject: [PATCH] chore(ci): release unversioned snapshot when integration tests pass (#846) Signed-off-by: Daniel Pacak --- .github/workflows/build.yaml | 67 ++++++++++++----------- .github/workflows/mkdocs-deploy.yaml | 1 + .github/workflows/publish-helm-chart.yaml | 2 +- .github/workflows/release.yaml | 8 ++- 4 files changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0528bcd69..f433c7fc5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,3 +1,4 @@ +--- # This workflow is triggered on push or pull request for the main branch. # It runs tests and various checks to validate that the proposed changes # will not introduce any regression after merging the code to the main branch. @@ -28,8 +29,8 @@ env: KIND_VERSION: "v0.11.1" KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6" jobs: - unit-tests: - name: Run unit tests + verify-code: + name: Verify code runs-on: ubuntu-20.04 steps: - name: Setup Go @@ -38,23 +39,28 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Checkout code uses: actions/checkout@v2 - - uses: actions/cache@v2 + - name: Cached Go dependencies + uses: actions/cache@v2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Run unit tests - run: make unit-tests - - name: Upload code coverage - uses: codecov/codecov-action@v2 + - name: Verify Go code + uses: golangci/golangci-lint-action@v2 with: - files: ./coverage.txt - release-snapshot: - name: Release unversioned snapshot - needs: - - unit-tests - - verify-code + args: --verbose + version: latest + skip-pkg-cache: true + skip-build-cache: true + - name: Verify YAML code + uses: ibiqlik/action-yamllint@v3 + - name: Vendor Go modules + run: go mod vendor + - name: Verify generated Go code + run: GOPATH="$(go env GOPATH)" ./hack/verify-codegen.sh + unit-tests: + name: Run unit tests runs-on: ubuntu-20.04 steps: - name: Setup Go @@ -69,12 +75,13 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Release snapshot - uses: goreleaser/goreleaser-action@v2 + - name: Run unit tests + run: make unit-tests + - name: Upload code coverage + uses: codecov/codecov-action@v2 with: - version: v0.183.0 - args: release --snapshot --skip-publish --rm-dist - itest-starboard: + files: ./coverage.txt + itest-starboard-cli: name: Run integration tests / Starboard CLI needs: - unit-tests @@ -208,8 +215,12 @@ jobs: uses: codecov/codecov-action@v2 with: files: ./itest/starboard-operator/configauditreport/conftest/coverage.txt - verify-code: - name: Verify code + release-snapshot: + name: Release unversioned snapshot + needs: + - itest-starboard-cli + - itest-starboard-operator + - integration-operator-conftest runs-on: ubuntu-20.04 steps: - name: Setup Go @@ -224,16 +235,8 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Setup golangci-lint - uses: golangci/golangci-lint-action@v2 + - name: Release snapshot + uses: goreleaser/goreleaser-action@v2 with: - args: --verbose - version: latest - skip-pkg-cache: true - skip-build-cache: true - - name: Verify YAML code - uses: ibiqlik/action-yamllint@v3 - - name: Vendor Go modules - run: go mod vendor - - name: Verify generated Go code - run: GOPATH="$(go env GOPATH)" ./hack/verify-codegen.sh + version: v1.1.0 + args: release --snapshot --skip-publish --rm-dist diff --git a/.github/workflows/mkdocs-deploy.yaml b/.github/workflows/mkdocs-deploy.yaml index 7369d24f2..9f65f0882 100644 --- a/.github/workflows/mkdocs-deploy.yaml +++ b/.github/workflows/mkdocs-deploy.yaml @@ -1,3 +1,4 @@ +--- # This is a manually triggered workflow to build and publish the MkDocs from the # main branch to GitHub pages at https://aquasecurity.github.io/starboard. name: Deploy documentation diff --git a/.github/workflows/publish-helm-chart.yaml b/.github/workflows/publish-helm-chart.yaml index d4cde7178..452ad99b2 100644 --- a/.github/workflows/publish-helm-chart.yaml +++ b/.github/workflows/publish-helm-chart.yaml @@ -1,6 +1,6 @@ +--- # This is a manually triggered workflow to package and upload the Helm chart from the # main branch to Aqua Security repository at https://github.com/aquasecurity/helm-charts. - name: Publish Helm chart on: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e8d4e5fc2..023538c0b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,9 @@ +--- +# This workflow is triggered whenever we release a new version of Starboard +# by creating an annotated Git tag and pushing it to the upstream Git repository. +# +# git tag -a v0.0.1 -m 'Release v0.0.1' +# git push upstream v0.0.1 name: Release on: push: @@ -183,7 +189,7 @@ jobs: - name: Release uses: goreleaser/goreleaser-action@v2 with: - version: v0.183.0 + version: v1.1.0 args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}