diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7a6521e..0a2d8b0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ on: env: # Common versions - GO_VERSION: '1.23' + XPKG_REG_ORGS: "registry.cennso.com/public/forked/crossplane registry.cennso.com/cennso-dev/forked/crossplane" GOLANGCI_VERSION: 'v2.1.2' - DOCKER_BUILDX_VERSION: 'v0.8.2' + DOCKER_BUILDX_VERSION: "v0.26.1" jobs: detect-noop: @@ -39,10 +39,9 @@ jobs: with: submodules: true - - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@v6 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Vendor Dependencies run: make vendor vendor.check @@ -63,10 +62,9 @@ jobs: with: submodules: true - - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@v6 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Vendor Dependencies run: make vendor vendor.check @@ -88,10 +86,9 @@ jobs: - name: Fetch History run: git fetch --prune --unshallow - - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@v6 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Vendor Dependencies run: make vendor vendor.check @@ -130,10 +127,9 @@ jobs: - name: Fetch History run: git fetch --prune --unshallow - - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + - uses: actions/setup-go@v6 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod - name: Vendor Dependencies run: make vendor vendor.check @@ -146,4 +142,39 @@ jobs: BUILD_ARGS: "--load" - name: Run E2E Tests - run: make e2e USE_HELM3=true \ No newline at end of file + run: make e2e USE_HELM3=true + + push-provider: + runs-on: [ubuntu-24.04] + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: true + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: ${{ env.DOCKER_BUILDX_VERSION }} + install: true + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_SERVER }} + username: ${{ secrets.CUR_REGISTRY_USERNAME }} + password: ${{ secrets.CUR_REGISTRY_PASSWORD }} + - name: Get version + id: get_version + run: echo "version=0.0.0-$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT + - name: Build Helm Charts + run: | + VERSION="${{ steps.get_version.outputs.version }}" make build.all + - name: Push to registry + run: |- + XPKG_REG_ORGS="${{ env.XPKG_REG_ORGS }}" VERSION="${{ steps.get_version.outputs.version }}" make helm.push + env: + # We're using docker buildx, which doesn't actually load the images it + # builds by default. Specifying --load does so. + BUILD_ARGS: "--load" diff --git a/.github/workflows/publish-provider-package.yaml b/.github/workflows/publish-provider-package.yaml deleted file mode 100644 index 26c4cfd9..00000000 --- a/.github/workflows/publish-provider-package.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish Provider Package - -on: - workflow_dispatch: - inputs: - version: - description: "Version string to use while publishing the package (e.g. v1.0.0-alpha.1)" - default: '' - required: false - go-version: - description: 'Go version to use if building needs to be done' - default: '1.24' - required: false - -jobs: - publish-provider-package: - uses: crossplane-contrib/provider-workflows/.github/workflows/publish-provider-non-family.yml@main - with: - repository: provider-helm - version: ${{ github.event.inputs.version }} - go-version: ${{ github.event.inputs.go-version }} - cleanup-disk: true - secrets: - GHCR_PAT: ${{ secrets.GITHUB_TOKEN }} - XPKG_MIRROR_TOKEN: ${{ secrets.XPKG_TOKEN }} - XPKG_MIRROR_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..945273f1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,43 @@ +name: Release +"on": + push: + tags: ["v*.*.*"] +env: + REGISTRY_SERVER: registry.cennso.com + DOCKER_BUILDX_VERSION: "v0.26.1" + XPKG_REG_ORGS: "registry.cennso.com/public/forked/crossplane registry.cennso.com/cennso/forked/crossplane" +jobs: + push-provider: + runs-on: [ubuntu-24.04] + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + submodules: true + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: ${{ env.DOCKER_BUILDX_VERSION }} + install: true + - uses: actions/setup-go@v6 + with: + go-version-file: go.mod + - id: get_version + name: Get latest release version number + uses: battila7/get-version-action@v2 + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_SERVER }} + username: ${{ secrets.CUR_REGISTRY_USERNAME }} + password: ${{ secrets.CUR_REGISTRY_PASSWORD }} + - name: Build Helm Charts + run: | + VERSION="${{ steps.get_version.outputs.version }}" make build.all + - name: Push to registry + run: |- + XPKG_REG_ORGS="${{ env.XPKG_REG_ORGS }}" VERSION="${{ steps.get_version.outputs.version }}" OCI_REGISTRY=oci://registry.cennso.com/cennso/charts make publish + env: + # We're using docker buildx, which doesn't actually load the images it + # builds by default. Specifying --load does so. + BUILD_ARGS: "--load" diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml deleted file mode 100644 index ddf3aec4..00000000 --- a/.github/workflows/tag.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Tag - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version (e.g. v0.1.0)' - required: true - message: - description: 'Tag message' - required: true - -jobs: - create-tag: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Create Tag - uses: negz/create-tag@v1 - with: - version: ${{ github.event.inputs.version }} - message: ${{ github.event.inputs.message }} - token: ${{ secrets.GITHUB_TOKEN }} -