From 31c440e621aaacaf41b20146381aecb3977735c8 Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Fri, 13 Oct 2023 11:10:52 +0800 Subject: [PATCH 1/9] feat: add gh workflow --- .github/workflows/publish_docker.yml | 163 +++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 .github/workflows/publish_docker.yml diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml new file mode 100644 index 00000000..9e86aa9c --- /dev/null +++ b/.github/workflows/publish_docker.yml @@ -0,0 +1,163 @@ +name: Build Production +on: + push: + branches: + - "main" +jobs: + release: + runs-on: ubuntu-20.04 + outputs: + published: ${{ steps.semantic.outputs.new_release_published }} + version: ${{ steps.semantic.outputs.new_release_version }} + steps: + - uses: actions/checkout@v3 + - id: semantic + uses: cycjimmy/semantic-release-action@v3 + with: + semantic_version: 18 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ACTION }} + + docker_x86_release: + needs: release + runs-on: ubuntu-20.04 + if: needs.release.outputs.published == 'true' + timeout-minutes: 120 + env: + arch: amd64 + outputs: + image_digest: ${{ steps.build.outputs.digest }} + steps: + - id: meta + uses: docker/metadata-action@v4 + with: + images: | + supabase/supavisor + tags: | + type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} + type=raw,value=latest_${{ env.arch }} + + - uses: docker/setup-buildx-action@v2 + + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - id: build + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + platforms: linux/${{ env.arch }} + cache-from: type=gha + cache-to: type=gha,mode=max + + docker_arm_release: + needs: release + runs-on: arm-runner + if: needs.release.outputs.published == 'true' + timeout-minutes: 120 + env: + arch: arm64 + outputs: + image_digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v3 + + - id: meta + uses: docker/metadata-action@v4 + with: + images: | + supabase/supavisor + tags: | + type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} + type=raw,value=latest_${{ env.arch }} + + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - uses: docker/setup-buildx-action@v2 + with: + driver: docker + driver-opts: | + image=moby/buildkit:master + network=host + + - id: build + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + platforms: linux/${{ env.arch }} + no-cache: true + + merge_manifest: + needs: [release, docker_x86_release, docker_arm_release] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + steps: + - uses: docker/setup-buildx-action@v2 + + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Merge multi-arch manifests for versioned output + run: | + docker buildx imagetools create -t supabase/supavisor:v${{ needs.release.outputs.version }} \ + supabase/supavisor@${{ needs.docker_x86_release.outputs.image_digest }} \ + supabase/supavisor@${{ needs.docker_arm_release.outputs.image_digest }} + + - name: Merge multi-arch manifests for latest output + run: | + docker buildx imagetools create -t supabase/supavisor:latest \ + supabase/supavisor@${{ needs.docker_x86_release.outputs.image_digest }} \ + supabase/supavisor@${{ needs.docker_arm_release.outputs.image_digest }} + + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.PROD_AWS_ROLE }} + aws-region: us-east-1 + + - name: Login to ECR + uses: docker/login-action@v2 + with: + registry: public.ecr.aws + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Mirror to ECR + uses: akhilerm/tag-push-action@v2.0.0 + with: + src: docker.io/supabase/supavisor:v${{ needs.release.outputs.version }} + dst: | + public.ecr.aws/supabase/supavisor:v${{ needs.release.outputs.version }} + ghcr.io/supabase/supavisor:v${{ needs.release.outputs.version }} + + update-branch-name: + needs: [release, docker_x86_release, docker_arm_release, merge_manifest] + runs-on: ubuntu-latest + steps: + - name: Checkout branch + uses: actions/checkout@v2 + with: + ref: refs/heads/main + + - name: Update branch name + run: | + git branch -m main releases/v${{ needs.release.outputs.version }} + git push origin HEAD:releases/v${{ needs.release.outputs.version }} From 4fb204592fe456b7e6369e69491c0266b785e360 Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Fri, 13 Oct 2023 11:17:40 +0800 Subject: [PATCH 2/9] feat: bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 56f31511..8225a4ba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.10 +0.9.11 From 7106f4f0c538e0d05cdf2d6b51d63fc391dd7689 Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Fri, 13 Oct 2023 22:04:46 +0800 Subject: [PATCH 3/9] fix: update to mirror Postgres format --- .github/workflows/release.yml | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..947e89d2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,98 @@ +name: Release on Dockerhub + +on: + push: + branches: + - develop + paths: + - ".github/workflows/dockerhub-release.yml" + - "VERSION" + +jobs: + settings: + runs-on: ubuntu-latest + outputs: + # TODO: Edit this section + docker_version: ${{ steps.settings.outputs.postgres-version }} + image_tag: supabase/supavisor:${{ steps.settings.outputs.postgres-version }} + build_args: ${{ steps.args.outputs.result }} + steps: + - uses: actions/checkout@v3 + - id: settings + # Remove spaces and quotes to get the raw version string + run: sed -r 's/(\s|\")+//g' VERSION >> $GITHUB_OUTPUT + + build_image: + needs: settings + strategy: + matrix: + include: + - runner: [self-hosted, X64] + arch: amd64 + - runner: arm-runner + arch: arm64 + runs-on: ${{ matrix.runner }} + timeout-minutes: 180 + outputs: + image_digest: ${{ steps.build.outputs.digest }} + steps: + - run: docker context create builders + - uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - id: build + uses: docker/build-push-action@v5 + with: + push: true + build-args: | + ${{ needs.settings.outputs.build_args }} + target: production + tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} + platforms: linux/${{ matrix.arch }} + cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + - name: Slack Notification + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: "gha-failures-notifier" + SLACK_COLOR: "danger" + SLACK_MESSAGE: "Building Supavisor ${{ matrix.arch }} image failed" + SLACK_FOOTER: "" + + merge_manifest: + needs: [settings, build_image] + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Merge multi-arch manifests + run: | + docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ + ${{ needs.settings.outputs.image_tag }}_amd64 \ + ${{ needs.settings.outputs.image_tag }}_arm64 + - name: Slack Notification + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: "gha-failures-notifier" + SLACK_COLOR: "danger" + SLACK_MESSAGE: "Building Postgres image failed" + SLACK_FOOTER: "" + + publish: + needs: [settings, merge_manifest] + # Call workflow explicitly because events from actions cannot trigger more actions + uses: ./.github/workflows/mirror.yml + with: + version: ${{ needs.settings.outputs.docker_version }} + secrets: inherit From 360d5751839f9834eabf2d5811420283070e8efd Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Fri, 13 Oct 2023 22:06:44 +0800 Subject: [PATCH 4/9] fix: bump version --- .github/workflows/publish_docker.yml | 207 +++++++++------------------ .github/workflows/release.yml | 98 ------------- VERSION | 2 +- 3 files changed, 72 insertions(+), 235 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 9e86aa9c..947e89d2 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -1,163 +1,98 @@ -name: Build Production +name: Release on Dockerhub + on: push: branches: - - "main" + - develop + paths: + - ".github/workflows/dockerhub-release.yml" + - "VERSION" + jobs: - release: - runs-on: ubuntu-20.04 + settings: + runs-on: ubuntu-latest outputs: - published: ${{ steps.semantic.outputs.new_release_published }} - version: ${{ steps.semantic.outputs.new_release_version }} + # TODO: Edit this section + docker_version: ${{ steps.settings.outputs.postgres-version }} + image_tag: supabase/supavisor:${{ steps.settings.outputs.postgres-version }} + build_args: ${{ steps.args.outputs.result }} steps: - uses: actions/checkout@v3 - - id: semantic - uses: cycjimmy/semantic-release-action@v3 - with: - semantic_version: 18 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PROJECT_ACTION }} - - docker_x86_release: - needs: release - runs-on: ubuntu-20.04 - if: needs.release.outputs.published == 'true' - timeout-minutes: 120 - env: - arch: amd64 + - id: settings + # Remove spaces and quotes to get the raw version string + run: sed -r 's/(\s|\")+//g' VERSION >> $GITHUB_OUTPUT + + build_image: + needs: settings + strategy: + matrix: + include: + - runner: [self-hosted, X64] + arch: amd64 + - runner: arm-runner + arch: arm64 + runs-on: ${{ matrix.runner }} + timeout-minutes: 180 outputs: image_digest: ${{ steps.build.outputs.digest }} steps: - - id: meta - uses: docker/metadata-action@v4 + - run: docker context create builders + - uses: docker/setup-buildx-action@v3 with: - images: | - supabase/supavisor - tags: | - type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} - type=raw,value=latest_${{ env.arch }} - - - uses: docker/setup-buildx-action@v2 - + endpoint: builders - uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: push: true - tags: ${{ steps.meta.outputs.tags }} - platforms: linux/${{ env.arch }} - cache-from: type=gha - cache-to: type=gha,mode=max - - docker_arm_release: - needs: release - runs-on: arm-runner - if: needs.release.outputs.published == 'true' - timeout-minutes: 120 - env: - arch: arm64 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - uses: actions/checkout@v3 - - - id: meta - uses: docker/metadata-action@v4 - with: - images: | - supabase/supavisor - tags: | - type=raw,value=v${{ needs.release.outputs.version }}_${{ env.arch }} - type=raw,value=latest_${{ env.arch }} - - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - uses: docker/setup-buildx-action@v2 - with: - driver: docker - driver-opts: | - image=moby/buildkit:master - network=host - - - id: build - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - platforms: linux/${{ env.arch }} - no-cache: true + build-args: | + ${{ needs.settings.outputs.build_args }} + target: production + tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} + platforms: linux/${{ matrix.arch }} + cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} + - name: Slack Notification + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: "gha-failures-notifier" + SLACK_COLOR: "danger" + SLACK_MESSAGE: "Building Supavisor ${{ matrix.arch }} image failed" + SLACK_FOOTER: "" merge_manifest: - needs: [release, docker_x86_release, docker_arm_release] + needs: [settings, build_image] runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write steps: - - uses: docker/setup-buildx-action@v2 - + - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Merge multi-arch manifests for versioned output + - name: Merge multi-arch manifests run: | - docker buildx imagetools create -t supabase/supavisor:v${{ needs.release.outputs.version }} \ - supabase/supavisor@${{ needs.docker_x86_release.outputs.image_digest }} \ - supabase/supavisor@${{ needs.docker_arm_release.outputs.image_digest }} - - - name: Merge multi-arch manifests for latest output - run: | - docker buildx imagetools create -t supabase/supavisor:latest \ - supabase/supavisor@${{ needs.docker_x86_release.outputs.image_digest }} \ - supabase/supavisor@${{ needs.docker_arm_release.outputs.image_digest }} - - - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: ${{ secrets.PROD_AWS_ROLE }} - aws-region: us-east-1 - - - name: Login to ECR - uses: docker/login-action@v2 - with: - registry: public.ecr.aws - - - name: Login to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Mirror to ECR - uses: akhilerm/tag-push-action@v2.0.0 - with: - src: docker.io/supabase/supavisor:v${{ needs.release.outputs.version }} - dst: | - public.ecr.aws/supabase/supavisor:v${{ needs.release.outputs.version }} - ghcr.io/supabase/supavisor:v${{ needs.release.outputs.version }} - - update-branch-name: - needs: [release, docker_x86_release, docker_arm_release, merge_manifest] - runs-on: ubuntu-latest - steps: - - name: Checkout branch - uses: actions/checkout@v2 - with: - ref: refs/heads/main - - - name: Update branch name - run: | - git branch -m main releases/v${{ needs.release.outputs.version }} - git push origin HEAD:releases/v${{ needs.release.outputs.version }} + docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ + ${{ needs.settings.outputs.image_tag }}_amd64 \ + ${{ needs.settings.outputs.image_tag }}_arm64 + - name: Slack Notification + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: "gha-failures-notifier" + SLACK_COLOR: "danger" + SLACK_MESSAGE: "Building Postgres image failed" + SLACK_FOOTER: "" + + publish: + needs: [settings, merge_manifest] + # Call workflow explicitly because events from actions cannot trigger more actions + uses: ./.github/workflows/mirror.yml + with: + version: ${{ needs.settings.outputs.docker_version }} + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 947e89d2..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Release on Dockerhub - -on: - push: - branches: - - develop - paths: - - ".github/workflows/dockerhub-release.yml" - - "VERSION" - -jobs: - settings: - runs-on: ubuntu-latest - outputs: - # TODO: Edit this section - docker_version: ${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/supavisor:${{ steps.settings.outputs.postgres-version }} - build_args: ${{ steps.args.outputs.result }} - steps: - - uses: actions/checkout@v3 - - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' VERSION >> $GITHUB_OUTPUT - - build_image: - needs: settings - strategy: - matrix: - include: - - runner: [self-hosted, X64] - arch: amd64 - - runner: arm-runner - arch: arm64 - runs-on: ${{ matrix.runner }} - timeout-minutes: 180 - outputs: - image_digest: ${{ steps.build.outputs.digest }} - steps: - - run: docker context create builders - - uses: docker/setup-buildx-action@v3 - with: - endpoint: builders - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - id: build - uses: docker/build-push-action@v5 - with: - push: true - build-args: | - ${{ needs.settings.outputs.build_args }} - target: production - tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} - platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Supavisor ${{ matrix.arch }} image failed" - SLACK_FOOTER: "" - - merge_manifest: - needs: [settings, build_image] - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Merge multi-arch manifests - run: | - docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ - ${{ needs.settings.outputs.image_tag }}_amd64 \ - ${{ needs.settings.outputs.image_tag }}_arm64 - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres image failed" - SLACK_FOOTER: "" - - publish: - needs: [settings, merge_manifest] - # Call workflow explicitly because events from actions cannot trigger more actions - uses: ./.github/workflows/mirror.yml - with: - version: ${{ needs.settings.outputs.docker_version }} - secrets: inherit diff --git a/VERSION b/VERSION index 8225a4ba..583b27ac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.11 +0.9.12 From ab7be67eab66b1f58ae9ad164d683bbcdb788501 Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Wed, 18 Oct 2023 04:40:02 +0800 Subject: [PATCH 5/9] chore: mirror image --- .github/workflows/mirror.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/mirror.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 00000000..8178e8c4 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,42 @@ +name: Mirror Image + +on: + workflow_call: + inputs: + version: + required: true + type: string + workflow_dispatch: + inputs: + version: + description: "Image tag" + required: true + type: string + +jobs: + mirror: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + steps: + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v2.2.0 + with: + role-to-assume: ${{ secrets.PROD_AWS_ROLE }} + aws-region: us-east-1 + - uses: docker/login-action@v2 + with: + registry: public.ecr.aws + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: akhilerm/tag-push-action@v2.1.0 + with: + src: docker.io/supabase/supavisor:${{ inputs.version }} + dst: | + public.ecr.aws/supabase/supavisor:${{ inputs.version }} + ghcr.io/supabase/supavisor:${{ inputs.version }} From 1a8d679a660d8bae8caa9176825b3fe4717c662f Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Wed, 18 Oct 2023 04:42:30 +0800 Subject: [PATCH 6/9] fix: bump VERSION --- .github/workflows/publish_docker.yml | 6 +++--- VERSION | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 947e89d2..62d6db2c 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest outputs: # TODO: Edit this section - docker_version: ${{ steps.settings.outputs.postgres-version }} - image_tag: supabase/supavisor:${{ steps.settings.outputs.postgres-version }} + docker_version: ${{ steps.settings.outputs.supavisor-version }} + image_tag: supabase/supavisor:${{ steps.settings.outputs.supavisor-version }} build_args: ${{ steps.args.outputs.result }} steps: - uses: actions/checkout@v3 @@ -86,7 +86,7 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} SLACK_USERNAME: "gha-failures-notifier" SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Postgres image failed" + SLACK_MESSAGE: "Building Supavisor image failed" SLACK_FOOTER: "" publish: diff --git a/VERSION b/VERSION index 583b27ac..f806549d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.12 +0.9.16 From 244afb5decfd42f5575df23afab21209fe9f6060 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Wed, 18 Oct 2023 13:54:05 +0800 Subject: [PATCH 7/9] chore: update publish workflow --- .github/workflows/publish_docker.yml | 40 +++++++--------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 62d6db2c..92aa847e 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -3,24 +3,23 @@ name: Release on Dockerhub on: push: branches: - - develop + - main + - j0/add_workflow_to_publish_docker_image paths: - - ".github/workflows/dockerhub-release.yml" + - ".github/workflows/publish_docker.yml" - "VERSION" jobs: settings: runs-on: ubuntu-latest outputs: - # TODO: Edit this section - docker_version: ${{ steps.settings.outputs.supavisor-version }} - image_tag: supabase/supavisor:${{ steps.settings.outputs.supavisor-version }} - build_args: ${{ steps.args.outputs.result }} + docker_version: ${{ steps.settings.outputs.result }} + image_tag: supabase/supavisor:${{ steps.settings.outputs.result }} steps: - uses: actions/checkout@v3 - id: settings - # Remove spaces and quotes to get the raw version string - run: sed -r 's/(\s|\")+//g' VERSION >> $GITHUB_OUTPUT + # Remove spaces to get the raw version string + run: echo "result=$(sed -r 's/\s+//g' VERSION)" >> $GITHUB_OUTPUT build_image: needs: settings @@ -48,22 +47,10 @@ jobs: uses: docker/build-push-action@v5 with: push: true - build-args: | - ${{ needs.settings.outputs.build_args }} - target: production tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} platforms: linux/${{ matrix.arch }} - cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }} - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Supavisor ${{ matrix.arch }} image failed" - SLACK_FOOTER: "" + cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ matrix.arch }} merge_manifest: needs: [settings, build_image] @@ -79,15 +66,6 @@ jobs: docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ ${{ needs.settings.outputs.image_tag }}_amd64 \ ${{ needs.settings.outputs.image_tag }}_arm64 - - name: Slack Notification - if: ${{ failure() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} - SLACK_USERNAME: "gha-failures-notifier" - SLACK_COLOR: "danger" - SLACK_MESSAGE: "Building Supavisor image failed" - SLACK_FOOTER: "" publish: needs: [settings, merge_manifest] From 6befc0bf9c11629af968cad767342ecc1d4b63f8 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Wed, 18 Oct 2023 13:59:11 +0800 Subject: [PATCH 8/9] chore: remove local changes --- .github/workflows/publish_docker.yml | 1 - VERSION | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 92aa847e..780051fa 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - j0/add_workflow_to_publish_docker_image paths: - ".github/workflows/publish_docker.yml" - "VERSION" diff --git a/VERSION b/VERSION index f806549d..56f31511 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.16 +0.9.10 From dc5809142bad6b532e0560921661c28164705edf Mon Sep 17 00:00:00 2001 From: Chase Granberry Date: Thu, 19 Oct 2023 14:46:14 -0700 Subject: [PATCH 9/9] fix: bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 56f31511..f7522682 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.10 +0.9.19