From 809be1637241897b0a6607ad4d686aec34635ae2 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Fri, 11 Oct 2024 23:00:01 -0400 Subject: [PATCH] attach rh to release page workflow --- .github/workflows/build-publish-rh-image.yml | 88 ++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/build-publish-rh-image.yml diff --git a/.github/workflows/build-publish-rh-image.yml b/.github/workflows/build-publish-rh-image.yml new file mode 100644 index 0000000000000..7ef4612daebf7 --- /dev/null +++ b/.github/workflows/build-publish-rh-image.yml @@ -0,0 +1,88 @@ +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +name: Build windmill-staging +on: + workflow_dispatch: + +permissions: write-all + +jobs: + build_ee: + runs-on: ubicloud + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Read EE repo commit hash + run: | + echo "ee_repo_ref=$(cat ./backend/ee-repo-ref.txt)" >> "$GITHUB_ENV" + + - uses: actions/checkout@v4 + with: + repository: windmill-labs/windmill-ee-private + path: ./windmill-ee-private + ref: ${{ env.ee_repo_ref }} + token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }} + fetch-depth: 0 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + - uses: depot/setup-action@v1 + + - name: Docker meta + id: meta-ee-public + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-staging-ee + flavor: | + latest=false + tags: | + type=sha + type=ref,event=branch + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Substitute EE code + run: | + ./backend/substitute_ee_code.sh --copy --dir ./windmill-ee-private + + - name: Build and push publicly ee + uses: depot/build-push-action@v1 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + build-args: | + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core + tags: | + ${{ steps.meta-ee-public.outputs.tags }} + labels: | + ${{ steps.meta-ee-public.outputs.labels }} + org.opencontainers.image.licenses=Windmill-Enterprise-License + + - uses: shrink/actions-docker-extract@v3 + id: extract-ee + with: + image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} + path: "/usr/src/app/windmill" + + - name: Rename binary with corresponding architecture + run: | + mv "${{ steps.extract.outputs.destination }}/windmill" "${{ steps.extract.outputs.destination }}/windmill-${ARCH}-rhel9" + mv "${{ steps.extract-ee.outputs.destination }}/windmill" "${{ steps.extract-ee.outputs.destination }}/windmill-ee-${ARCH}-rhel9" + + - name: Attach binary to release + uses: softprops/action-gh-release@v2 + with: + files: | + ${{ steps.extract.outputs.destination }}/* + ${{ steps.extract-ee.outputs.destination }}/*