|
| 1 | +name: Autogenerate AKO |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | +jobs: |
| 5 | + autogen: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + outputs: |
| 8 | + version: ${{ steps.build-version.outputs.version }} |
| 9 | + steps: |
| 10 | + - name: Checkout repository |
| 11 | + uses: actions/checkout@v5 |
| 12 | + - name: Set up Go |
| 13 | + uses: actions/setup-go@v5 |
| 14 | + with: |
| 15 | + go-version-file: "./go.mod" |
| 16 | + cache: true |
| 17 | + - name: Install controller-gen and kustomize |
| 18 | + run: | |
| 19 | + go install sigs.k8s.io/controller-tools/cmd/[email protected] |
| 20 | + go install sigs.k8s.io/kustomize/kustomize/[email protected] |
| 21 | + go get go.mongodb.org/atlas-sdk/[email protected] |
| 22 | + go get github.com/mongodb/mongodb-atlas-kubernetes/tools/crd2go |
| 23 | +
|
| 24 | + controller-gen --version |
| 25 | + kustomize version |
| 26 | + - name: Generate CRDs |
| 27 | + run: | |
| 28 | + make gen-crds |
| 29 | + - name: Generate Go types |
| 30 | + run: | |
| 31 | + make gen-go-types |
| 32 | + - name: Run Operator Scaffolder |
| 33 | + run: | |
| 34 | + make run-scaffolder |
| 35 | + - name: Build Version |
| 36 | + id: build-version |
| 37 | + run: | |
| 38 | + GITCOMMIT=$(git rev-parse --short HEAD) |
| 39 | + VERSION=$(jq -r .next version.json)-EXPERIMENTAL-${GITCOMMIT} |
| 40 | + echo "version=${VERSION}" >> "${GITHUB_OUTPUT}" |
| 41 | + - name: Log in to the Container Registry |
| 42 | + uses: docker/login-action@v3 |
| 43 | + with: |
| 44 | + registry: ghcr.io |
| 45 | + username: ${{ github.actor }} |
| 46 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + - name: Build Operator |
| 48 | + env: |
| 49 | + EXPERIMENTAL: true |
| 50 | + OPERATOR_IMAGE: "ghcr.io/${{ github.repository_owner }}/mongodb-atlas-kubernetes-operator-prerelease:${{ steps.build-version.outputs.version }}" |
| 51 | + run: | |
| 52 | + make image |
| 53 | + - name: (Auto)Generated manifests |
| 54 | + env: |
| 55 | + OPERATOR_IMAGE: "ghcr.io/${{ github.repository_owner }}/mongodb-atlas-kubernetes-operator-prerelease:${{ steps.build-version.outputs.version }}" |
| 56 | + run: | |
| 57 | + make deploy/generated/all-in-one.yaml |
| 58 | + - name: Upload All-in-One (autogenerated) manifest |
| 59 | + uses: actions/upload-artifact@v4 |
| 60 | + with: |
| 61 | + name: all-in-one-autogen-manifest |
| 62 | + path: ./deploy/generated/all-in-one.yaml |
| 63 | + retention-days: 1 |
0 commit comments