From 0767858c1ad9b287960e35efdc8ab63fe12a2dc0 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 15:26:29 +0530 Subject: [PATCH 01/23] initial workflow for releasing homebrew tap --- .github/workflows/release-homebrew-tap.yaml | 33 +++++++++++++++++++++ .github/workflows/test-workflow.yaml | 12 ++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/release-homebrew-tap.yaml create mode 100644 .github/workflows/test-workflow.yaml diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml new file mode 100644 index 00000000..cc064c5c --- /dev/null +++ b/.github/workflows/release-homebrew-tap.yaml @@ -0,0 +1,33 @@ +name: Release Homebrew Tap + +on: + workflow_call: + inputs: + tag: + required: true + type: string + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Download Linux AMD64 package + uses: robinraju/release-downloader@v1.8 + with: + repository: "supabase/dbdev" + tag: ${{ inputs.tag }} + fileName: "dbdev-${{ inputs.tag }}-linux-amd64.tar.gz" + + - name: Download Linux ARM64 package + uses: robinraju/release-downloader@v1.8 + with: + repository: "supabase/dbdev" + tag: ${{ inputs.tag }} + fileName: "dbdev-${{ inputs.tag }}-linux-arm64.tar.gz" + + - name: Download macOS AMD64 package + uses: robinraju/release-downloader@v1.8 + with: + repository: "supabase/dbdev" + tag: ${{ inputs.tag }} + fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml new file mode 100644 index 00000000..160e9b6e --- /dev/null +++ b/.github/workflows/test-workflow.yaml @@ -0,0 +1,12 @@ +name: Call a reusable workflow + +on: + push: + branches: + - chore/release-workflow + +jobs: + call-release-workflow: + uses: ./.github/workflows/release-homebrew-tap.yaml + with: + tag: v0.1.2 From 0f89812d949a4de833ba6b9e2ddfde532d2fe8d9 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 15:30:48 +0530 Subject: [PATCH 02/23] compute sha256 hash --- .github/workflows/release-homebrew-tap.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index cc064c5c..06f8debb 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -31,3 +31,9 @@ jobs: repository: "supabase/dbdev" tag: ${{ inputs.tag }} fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" + + - name: Generate Manifest File + run: | + shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1 + shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1 + shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1 From 59ed4d622834811f5b3b6aec102fd6398a7fd96a Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 15:36:01 +0530 Subject: [PATCH 03/23] echo hashes --- .github/workflows/release-homebrew-tap.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 06f8debb..5f240361 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -34,6 +34,10 @@ jobs: - name: Generate Manifest File run: | - shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1 - shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1 - shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1 + linux_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1` + linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1` + macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1` + + echo $linux_amd64_hash + echo $linux_arm64_hash + echo $macos_amd64_hash From 9b2da2a45a28b0556b9d2ba1b375ab050a2b0255 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 15:52:31 +0530 Subject: [PATCH 04/23] generate manifest file --- .github/workflows/release-homebrew-tap.yaml | 58 +++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 5f240361..5732183c 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -38,6 +38,58 @@ jobs: linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1` macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1` - echo $linux_amd64_hash - echo $linux_arm64_hash - echo $macos_amd64_hash + tag=${{ inputs.tag }} + # strip the leading v + version=${tag:1} + + touch dbdev.rb + + echo '# typed: false' > dbdev.rb + echo '# frozen_string_literal: true' >> dbdev.rb + echo '' >> dbdev.rb + echo 'class Dbdev < Formula' >> dbdev.rb + echo ' desc "Dbdev CLI"' >> dbdev.rb + echo ' homepage "https://database.dev/"' >> dbdev.rb + echo " version \"${version}\"" >> dbdev.rb + echo ' license "MIT"' >> dbdev.rb + echo '' >> dbdev.rb + echo ' on_macos do' >> dbdev.rb + echo ' if Hardware::CPU.arm?' >> dbdev.rb + echo " url \"https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-macos-amd64.tar.gz\"" >> dbdev.rb + echo " sha256 \"${macos_amd64_hash}\"" >> dbdev.rb + echo '' >> dbdev.rb + echo ' def install' >> dbdev.rb + echo ' bin.install "dbdev"' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' if Hardware::CPU.intel?' >> dbdev.rb + echo " url \"https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-macos-amd64.tar.gz\"" >> dbdev.rb + echo " sha256 \"${macos_amd64_hash}\"" >> dbdev.rb + echo '' >> dbdev.rb + echo ' def install' >> dbdev.rb + echo ' bin.install "dbdev"' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo '' >> dbdev.rb + echo ' on_linux do' >> dbdev.rb + echo ' if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?' >> dbdev.rb + echo " url \"https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-linux-arm64.tar.gz\"" >> dbdev.rb + echo " sha256 \"${linux_arm64_hash}\"" >> dbdev.rb + echo '' >> dbdev.rb + echo ' def install' >> dbdev.rb + echo ' bin.install "dbdev"' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' if Hardware::CPU.intel?' >> dbdev.rb + echo " url "https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-linux-amd64.tar.gz"" >> dbdev.rb + echo " sha256 \"${linux_amd64_hash}\"" >> dbdev.rb + echo '' >> dbdev.rb + echo ' def install' >> dbdev.rb + echo ' bin.install "dbdev"' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo ' end' >> dbdev.rb + echo 'end' >> dbdev.rb + + cat dbdev.rb From fd352964b048b676a7e4a47c895ab98a72239085 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 16:02:28 +0530 Subject: [PATCH 05/23] escape double quotes --- .github/workflows/release-homebrew-tap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 5732183c..d31d7837 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -82,7 +82,7 @@ jobs: echo ' end' >> dbdev.rb echo ' end' >> dbdev.rb echo ' if Hardware::CPU.intel?' >> dbdev.rb - echo " url "https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-linux-amd64.tar.gz"" >> dbdev.rb + echo " url \"https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-linux-amd64.tar.gz\"" >> dbdev.rb echo " sha256 \"${linux_amd64_hash}\"" >> dbdev.rb echo '' >> dbdev.rb echo ' def install' >> dbdev.rb From d28503b27d4cc407b094080cc12cb105ec5966d6 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 16:34:35 +0530 Subject: [PATCH 06/23] checkout test repo --- .github/workflows/release-homebrew-tap.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index d31d7837..afbed89e 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -32,8 +32,16 @@ jobs: tag: ${{ inputs.tag }} fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" + - uses: actions/checkout@v3 + with: + repository: imor/homebrew-tap #TODO: replace with supabase/homebrew-tap after testing + ref: 'main' + token: ${{ secrets.HOMEBREW_TAP_RW }} + - name: Generate Manifest File run: | + ls -al + linux_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1` linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1` macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1` From 0a36d3eff7a9ec7ee820008af6aaa4334a2e3114 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 16:38:55 +0530 Subject: [PATCH 07/23] pass secret from caller --- .github/workflows/release-homebrew-tap.yaml | 5 ++++- .github/workflows/test-workflow.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index afbed89e..42dc0428 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -6,6 +6,9 @@ on: tag: required: true type: string + secrets: + homebrew_tap_rw: + required: true jobs: release: @@ -36,7 +39,7 @@ jobs: with: repository: imor/homebrew-tap #TODO: replace with supabase/homebrew-tap after testing ref: 'main' - token: ${{ secrets.HOMEBREW_TAP_RW }} + token: ${{ secrets.homebrew_tap_rw }} - name: Generate Manifest File run: | diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index 160e9b6e..6887a975 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -10,3 +10,4 @@ jobs: uses: ./.github/workflows/release-homebrew-tap.yaml with: tag: v0.1.2 + homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} From e708a1e19afa4beee5210dafb8a9324b78523440 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 16:45:47 +0530 Subject: [PATCH 08/23] correct secrets syntax --- .github/workflows/test-workflow.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index 6887a975..a0fe3846 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -10,4 +10,5 @@ jobs: uses: ./.github/workflows/release-homebrew-tap.yaml with: tag: v0.1.2 + secrets: homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} From 1a55013184f44ccd4cf34c69b5682ddbdc9f2390 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:07:13 +0530 Subject: [PATCH 09/23] push changes to homebrew-tap repo --- .github/workflows/release-homebrew-tap.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 42dc0428..27010b31 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -43,8 +43,6 @@ jobs: - name: Generate Manifest File run: | - ls -al - linux_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1` linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1` macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1` @@ -53,8 +51,6 @@ jobs: # strip the leading v version=${tag:1} - touch dbdev.rb - echo '# typed: false' > dbdev.rb echo '# frozen_string_literal: true' >> dbdev.rb echo '' >> dbdev.rb @@ -103,4 +99,10 @@ jobs: echo ' end' >> dbdev.rb echo 'end' >> dbdev.rb - cat dbdev.rb + git diff + + git config user.name "dbdev release-homebrew-tap.yaml workflow" + git config user.email raminder@supabase.io + git add . + git commit -m "dbdev brew formula update for version v${version}" + git push From c43ba5a40a3f4ca69de26020960f65635005d3bd Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:07:33 +0530 Subject: [PATCH 10/23] use version v0.1.1 --- .github/workflows/test-workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index a0fe3846..04650118 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -9,6 +9,6 @@ jobs: call-release-workflow: uses: ./.github/workflows/release-homebrew-tap.yaml with: - tag: v0.1.2 + tag: v0.1.1 secrets: homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} From 6339fb6ea144b515033e5327f6ba995a03c383f9 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:13:36 +0530 Subject: [PATCH 11/23] move checkout step before every other --- .github/workflows/release-homebrew-tap.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 27010b31..7612b22d 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -14,6 +14,11 @@ jobs: release: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + with: + repository: imor/homebrew-tap #TODO: replace with supabase/homebrew-tap after testing + ref: 'main' + token: ${{ secrets.homebrew_tap_rw }} - name: Download Linux AMD64 package uses: robinraju/release-downloader@v1.8 with: @@ -35,12 +40,6 @@ jobs: tag: ${{ inputs.tag }} fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" - - uses: actions/checkout@v3 - with: - repository: imor/homebrew-tap #TODO: replace with supabase/homebrew-tap after testing - ref: 'main' - token: ${{ secrets.homebrew_tap_rw }} - - name: Generate Manifest File run: | linux_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1` @@ -103,6 +102,6 @@ jobs: git config user.name "dbdev release-homebrew-tap.yaml workflow" git config user.email raminder@supabase.io - git add . + git add ./dbdev.rb git commit -m "dbdev brew formula update for version v${version}" git push From 7753c4d6db4399de1900c50855f97b5315ed6713 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:13:55 +0530 Subject: [PATCH 12/23] use version v0.1.2 --- .github/workflows/test-workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index 04650118..a0fe3846 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -9,6 +9,6 @@ jobs: call-release-workflow: uses: ./.github/workflows/release-homebrew-tap.yaml with: - tag: v0.1.1 + tag: v0.1.2 secrets: homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} From e3a607784861a05055ed125c8e94d5fc13925fcd Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:18:44 +0530 Subject: [PATCH 13/23] rename a step --- .github/workflows/release-homebrew-tap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 7612b22d..ceaf35c9 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -40,7 +40,7 @@ jobs: tag: ${{ inputs.tag }} fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" - - name: Generate Manifest File + - name: Generate and Push Manifest File run: | linux_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-amd64.tar.gz | cut -d" " -f1` linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1` From 9133443771113a0701e8fcef1ecb20ab364a79f6 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:36:26 +0530 Subject: [PATCH 14/23] add release-scoop-bucket workflow --- .github/workflows/release-homebrew-tap.yaml | 1 + .github/workflows/release-scoop-bucket.yaml | 61 +++++++++++++++++++++ .github/workflows/test-workflow.yaml | 11 +++- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-scoop-bucket.yaml diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index ceaf35c9..623c314f 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -50,6 +50,7 @@ jobs: # strip the leading v version=${tag:1} + # update dbdev.rb file echo '# typed: false' > dbdev.rb echo '# frozen_string_literal: true' >> dbdev.rb echo '' >> dbdev.rb diff --git a/.github/workflows/release-scoop-bucket.yaml b/.github/workflows/release-scoop-bucket.yaml new file mode 100644 index 00000000..205983f4 --- /dev/null +++ b/.github/workflows/release-scoop-bucket.yaml @@ -0,0 +1,61 @@ +name: Release Scoop Bucket + +on: + workflow_call: + inputs: + tag: + required: true + type: string + secrets: + scoop_bucket_rw: + required: true + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + repository: imor/scoop-bucket #TODO: replace with supabase/scoop-bucket after testing + ref: 'main' + token: ${{ secrets.scoop_bucket_rw }} + + - name: Download Windows AMD64 package + uses: robinraju/release-downloader@v1.8 + with: + repository: "supabase/dbdev" + tag: ${{ inputs.tag }} + fileName: "dbdev-${{ inputs.tag }}-windows-amd64.zip" + + - name: Generate and Push Manifest File + run: | + windows_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-windows-amd64.zip | cut -d" " -f1` + + tag=${{ inputs.tag }} + # strip the leading v + version=${tag:1} + + # update dbdev.json file + echo '{' > dbdev.json + echo " \"version\": \"${version}\"," >> dbdev.json + echo ' "architecture": {' >> dbdev.json + echo ' "64bit": {' >> dbdev.json + echo " \"url\": \"https://github.com/supabase/dbdev/releases/download/v${version}/dbdev-v${version}-windows-amd64.zip\"," >> dbdev.json + echo ' "bin": [' >> dbdev.json + echo ' "dbdev.exe"' >> dbdev.json + echo ' ],' >> dbdev.json + echo " \"hash\": \"${windows_amd64_hash}\"" >> dbdev.json + echo ' }' >> dbdev.json + echo ' },' >> dbdev.json + echo ' "homepage": "https://database.dev",' >> dbdev.json + echo ' "license": "Apache",' >> dbdev.json + echo ' "description": "CLI to help publish extensions to database.dev"' >> dbdev.json + echo '}' >> dbdev.json + + git diff + + git config user.name "dbdev release-scoop-bucket.yaml workflow" + git config user.email raminder@supabase.io + git add ./dbdev.json + git commit -m "dbdev scoop update for version v${version}" + git push diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/test-workflow.yaml index a0fe3846..95a8eaec 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/test-workflow.yaml @@ -6,9 +6,16 @@ on: - chore/release-workflow jobs: - call-release-workflow: + call-release-homebrew-tap: uses: ./.github/workflows/release-homebrew-tap.yaml with: - tag: v0.1.2 + tag: v0.1.1 secrets: homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} + + call-release-scoop-bucket: + uses: ./.github/workflows/release-scoop-bucket.yaml + with: + tag: v0.1.1 + secrets: + scoop_bucket_rw: ${{ secrets.SCOOP_BUCKET_RW }} From 9cbc27ce3f52408e75a8a0ef709187436c8cec8b Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:38:31 +0530 Subject: [PATCH 15/23] add trailing newline to generated manifest files --- .github/workflows/release-homebrew-tap.yaml | 1 + .github/workflows/release-scoop-bucket.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index 623c314f..f210f0c6 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -98,6 +98,7 @@ jobs: echo ' end' >> dbdev.rb echo ' end' >> dbdev.rb echo 'end' >> dbdev.rb + echo '' git diff diff --git a/.github/workflows/release-scoop-bucket.yaml b/.github/workflows/release-scoop-bucket.yaml index 205983f4..886e1773 100644 --- a/.github/workflows/release-scoop-bucket.yaml +++ b/.github/workflows/release-scoop-bucket.yaml @@ -51,6 +51,7 @@ jobs: echo ' "license": "Apache",' >> dbdev.json echo ' "description": "CLI to help publish extensions to database.dev"' >> dbdev.json echo '}' >> dbdev.json + echo '' git diff From cc145029374374a70a1887b8ca56d94f74265d90 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:44:03 +0530 Subject: [PATCH 16/23] allow manual trigger to release brew & scoop --- ...low.yaml => manual-release-brew-and-scoop.yaml} | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename .github/workflows/{test-workflow.yaml => manual-release-brew-and-scoop.yaml} (58%) diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml similarity index 58% rename from .github/workflows/test-workflow.yaml rename to .github/workflows/manual-release-brew-and-scoop.yaml index 95a8eaec..68751576 100644 --- a/.github/workflows/test-workflow.yaml +++ b/.github/workflows/manual-release-brew-and-scoop.yaml @@ -1,21 +1,23 @@ -name: Call a reusable workflow +name: Release CLI on Homebrew and Scoop on: - push: - branches: - - chore/release-workflow + workflow_dispatch: + inputs: + tag: + description: "Tag to release (e.g. v1.2.3)" + required: true jobs: call-release-homebrew-tap: uses: ./.github/workflows/release-homebrew-tap.yaml with: - tag: v0.1.1 + tag: ${{ github.event.inputs.tag }} secrets: homebrew_tap_rw: ${{ secrets.HOMEBREW_TAP_RW }} call-release-scoop-bucket: uses: ./.github/workflows/release-scoop-bucket.yaml with: - tag: v0.1.1 + tag: ${{ github.event.inputs.tag }} secrets: scoop_bucket_rw: ${{ secrets.SCOOP_BUCKET_RW }} From e987a8c807aa770d3b2510c651fdf49d5e10dbdf Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:46:45 +0530 Subject: [PATCH 17/23] auto trigger once to show workflow in GH UI --- .../workflows/manual-release-brew-and-scoop.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual-release-brew-and-scoop.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml index 68751576..16e25867 100644 --- a/.github/workflows/manual-release-brew-and-scoop.yaml +++ b/.github/workflows/manual-release-brew-and-scoop.yaml @@ -1,11 +1,16 @@ name: Release CLI on Homebrew and Scoop +# on: +# workflow_dispatch: +# inputs: +# tag: +# description: 'Tag to release (e.g. v1.2.3)' +# required: true + on: - workflow_dispatch: - inputs: - tag: - description: "Tag to release (e.g. v1.2.3)" - required: true + push: + branches: + - chore/release-workflow jobs: call-release-homebrew-tap: From fb448d7d8f94acb9e2e80ff0d70355e6a33dc73f Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:48:42 +0530 Subject: [PATCH 18/23] rename file test-workflow --- .../{manual-release-brew-and-scoop.yaml => test-workflow.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{manual-release-brew-and-scoop.yaml => test-workflow.yaml} (100%) diff --git a/.github/workflows/manual-release-brew-and-scoop.yaml b/.github/workflows/test-workflow.yaml similarity index 100% rename from .github/workflows/manual-release-brew-and-scoop.yaml rename to .github/workflows/test-workflow.yaml From 715b1e046beb864953420142c41909b1aae9f56f Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:50:11 +0530 Subject: [PATCH 19/23] rename file --- .../{test-workflow.yaml => manual-release-brew-and-scoop.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test-workflow.yaml => manual-release-brew-and-scoop.yaml} (100%) diff --git a/.github/workflows/test-workflow.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml similarity index 100% rename from .github/workflows/test-workflow.yaml rename to .github/workflows/manual-release-brew-and-scoop.yaml From ee5cb9b31da1c5d2f40cdd6e183b8e7310e8730c Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:50:55 +0530 Subject: [PATCH 20/23] enable manual trigger --- .../workflows/manual-release-brew-and-scoop.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/manual-release-brew-and-scoop.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml index 16e25867..68751576 100644 --- a/.github/workflows/manual-release-brew-and-scoop.yaml +++ b/.github/workflows/manual-release-brew-and-scoop.yaml @@ -1,16 +1,11 @@ name: Release CLI on Homebrew and Scoop -# on: -# workflow_dispatch: -# inputs: -# tag: -# description: 'Tag to release (e.g. v1.2.3)' -# required: true - on: - push: - branches: - - chore/release-workflow + workflow_dispatch: + inputs: + tag: + description: "Tag to release (e.g. v1.2.3)" + required: true jobs: call-release-homebrew-tap: From af9ca011da060659269efac6c54fe05e123df831 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:55:02 +0530 Subject: [PATCH 21/23] enable both manual and auto trigger --- .github/workflows/manual-release-brew-and-scoop.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/manual-release-brew-and-scoop.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml index 68751576..30a36880 100644 --- a/.github/workflows/manual-release-brew-and-scoop.yaml +++ b/.github/workflows/manual-release-brew-and-scoop.yaml @@ -6,6 +6,9 @@ on: tag: description: "Tag to release (e.g. v1.2.3)" required: true + push: + branches: + - chore/release-workflow jobs: call-release-homebrew-tap: From fc90ba04c541e7aba1151f41156af32971f7736c Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:56:46 +0530 Subject: [PATCH 22/23] still doesn't show in ui, disabling auto trigger --- .github/workflows/manual-release-brew-and-scoop.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/manual-release-brew-and-scoop.yaml b/.github/workflows/manual-release-brew-and-scoop.yaml index 30a36880..68751576 100644 --- a/.github/workflows/manual-release-brew-and-scoop.yaml +++ b/.github/workflows/manual-release-brew-and-scoop.yaml @@ -6,9 +6,6 @@ on: tag: description: "Tag to release (e.g. v1.2.3)" required: true - push: - branches: - - chore/release-workflow jobs: call-release-homebrew-tap: From 68049413fb8c7a063465af9d3747123ff065bd2b Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 24 Oct 2023 17:58:14 +0530 Subject: [PATCH 23/23] update manifest repo names to supabase/* --- .github/workflows/release-homebrew-tap.yaml | 2 +- .github/workflows/release-scoop-bucket.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-homebrew-tap.yaml b/.github/workflows/release-homebrew-tap.yaml index f210f0c6..a537102f 100644 --- a/.github/workflows/release-homebrew-tap.yaml +++ b/.github/workflows/release-homebrew-tap.yaml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - repository: imor/homebrew-tap #TODO: replace with supabase/homebrew-tap after testing + repository: supabase/homebrew-tap ref: 'main' token: ${{ secrets.homebrew_tap_rw }} - name: Download Linux AMD64 package diff --git a/.github/workflows/release-scoop-bucket.yaml b/.github/workflows/release-scoop-bucket.yaml index 886e1773..c4d22331 100644 --- a/.github/workflows/release-scoop-bucket.yaml +++ b/.github/workflows/release-scoop-bucket.yaml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - repository: imor/scoop-bucket #TODO: replace with supabase/scoop-bucket after testing + repository: supabase/scoop-bucket ref: 'main' token: ${{ secrets.scoop_bucket_rw }}