-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from supabase/chore/release-workflow
create workflow to release to Homebrew and Scoop
- Loading branch information
Showing
3 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Release CLI on Homebrew and Scoop | ||
|
||
on: | ||
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: ${{ 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: ${{ github.event.inputs.tag }} | ||
secrets: | ||
scoop_bucket_rw: ${{ secrets.SCOOP_BUCKET_RW }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Release Homebrew Tap | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
secrets: | ||
homebrew_tap_rw: | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: supabase/homebrew-tap | ||
ref: 'main' | ||
token: ${{ secrets.homebrew_tap_rw }} | ||
- name: Download Linux AMD64 package | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: "supabase/dbdev" | ||
tag: ${{ inputs.tag }} | ||
fileName: "dbdev-${{ inputs.tag }}-linux-amd64.tar.gz" | ||
|
||
- name: Download Linux ARM64 package | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: "supabase/dbdev" | ||
tag: ${{ inputs.tag }} | ||
fileName: "dbdev-${{ inputs.tag }}-linux-arm64.tar.gz" | ||
|
||
- name: Download macOS AMD64 package | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: "supabase/dbdev" | ||
tag: ${{ inputs.tag }} | ||
fileName: "dbdev-${{ inputs.tag }}-macos-amd64.tar.gz" | ||
|
||
- 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` | ||
macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1` | ||
tag=${{ inputs.tag }} | ||
# 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 | ||
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 | ||
echo '' | ||
git diff | ||
git config user.name "dbdev release-homebrew-tap.yaml workflow" | ||
git config user.email [email protected] | ||
git add ./dbdev.rb | ||
git commit -m "dbdev brew formula update for version v${version}" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
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: supabase/scoop-bucket | ||
ref: 'main' | ||
token: ${{ secrets.scoop_bucket_rw }} | ||
|
||
- name: Download Windows AMD64 package | ||
uses: robinraju/[email protected] | ||
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 | ||
echo '' | ||
git diff | ||
git config user.name "dbdev release-scoop-bucket.yaml workflow" | ||
git config user.email [email protected] | ||
git add ./dbdev.json | ||
git commit -m "dbdev scoop update for version v${version}" | ||
git push |
97242fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dbdev – ./
www.database.dev
dbdev-supabase.vercel.app
dbdev.vercel.app
dbdev-git-master-supabase.vercel.app
database.dev