Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 74 additions & 5 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,89 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

publish-binaries:
name: Publish ${{ matrix.platform }}
needs:
- release
- goreleaser
if: needs.release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: darwin-amd64
os: darwin
arch: amd64
- platform: darwin-arm64
os: darwin
arch: arm64
- platform: linux-amd64
os: linux
arch: amd64
- platform: linux-arm64
os: linux
arch: arm64
- platform: windows-amd64
os: windows
arch: amd64
ext: .exe
- platform: windows-arm64
os: windows
arch: arm64
ext: .exe
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Download binary from release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download "v${{ needs.release.outputs.new-release-version }}" \
--pattern "supabase_${{ matrix.os }}_${{ matrix.arch }}.tar.gz" \
--repo ${{ github.repository }}
tar -xzf supabase_${{ matrix.os }}_${{ matrix.arch }}.tar.gz supabase${{ matrix.ext || '' }}
mv supabase${{ matrix.ext || '' }} npm/${{ matrix.platform }}/
chmod +x npm/${{ matrix.platform }}/supabase${{ matrix.ext || '' }}
rm supabase_${{ matrix.os }}_${{ matrix.arch }}.tar.gz
- name: Update package version
working-directory: npm/${{ matrix.platform }}
run: npm version ${{ needs.release.outputs.new-release-version }} --no-git-tag-version
- name: Publish to NPM
working-directory: npm/${{ matrix.platform }}
run: npm publish --tag ${{ needs.release.outputs.new-release-channel }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish:
name: Publish NPM
name: Publish main package
needs:
- release
- goreleaser
- publish-binaries
if: needs.release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: npm --git-tag-version=false version ${{ needs.release.outputs.new-release-version }}
- run: npm publish --tag ${{ needs.release.outputs.new-release-channel }}
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Update package versions
run: |
npm version ${{ needs.release.outputs.new-release-version }} --no-git-tag-version
node -e "
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const version = '${{ needs.release.outputs.new-release-version }}';
for (const dep in pkg.optionalDependencies) {
pkg.optionalDependencies[dep] = version;
}
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
"
- name: Publish to NPM
run: npm publish --tag ${{ needs.release.outputs.new-release-channel }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 27 additions & 4 deletions .github/workflows/tag-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,46 @@ on:
workflow_dispatch:
inputs:
release:
description: "v1.0.0"
description: 'v1.0.0'
required: true
type: string

permissions:
contents: read

jobs:
tag-binaries:
name: Tag ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- darwin-amd64
- darwin-arm64
- linux-amd64
- linux-arm64
- windows-amd64
- windows-arm64
steps:
- uses: actions/setup-node@v6
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm dist-tag add "supabase-${{ matrix.platform }}@${RELEASE_TAG#v}" latest
env:
RELEASE_TAG: ${{ inputs.release }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

tag:
name: Move latest tag
name: Tag main package
needs: tag-binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm dist-tag add "supabase@${RELEASE_TAG#v}" latest
env:
RELEASE_TAG: ${{ inputs.release }}
Expand Down
2 changes: 1 addition & 1 deletion cmd/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var (
}
body := api.V1CreateProjectBody{
Name: projectName,
OrganizationId: orgId,
OrganizationId: &orgId,
DbPass: dbPassword,
Region: cast.Ptr(api.V1CreateProjectBodyRegion(region.Value)),
}
Expand Down
8 changes: 5 additions & 3 deletions internal/projects/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ func promptMissingParams(ctx context.Context, body *api.V1CreateProjectBody) err
} else {
fmt.Fprintln(os.Stderr, printKeyValue("Creating project", body.Name))
}
if len(body.OrganizationId) == 0 {
if body.OrganizationId, err = promptOrgId(ctx); err != nil {
if body.OrganizationId == nil || len(*body.OrganizationId) == 0 {
orgId, err := promptOrgId(ctx)
if err != nil {
return err
}
fmt.Fprintln(os.Stderr, printKeyValue("Selected org-id", body.OrganizationId))
body.OrganizationId = &orgId
fmt.Fprintln(os.Stderr, printKeyValue("Selected org-id", *body.OrganizationId))
}
if body.Region == nil || len(*body.Region) == 0 {
region, err := promptProjectRegion(ctx)
Expand Down
14 changes: 14 additions & 0 deletions npm/darwin-amd64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "supabase-darwin-amd64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"darwin"
],
"cpu": [
"x64"
],
"files": [
"supabase"
]
}
14 changes: 14 additions & 0 deletions npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "supabase-darwin-arm64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"files": [
"supabase"
]
}
17 changes: 17 additions & 0 deletions npm/linux-amd64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "supabase-linux-amd64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"linux"
],
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"files": [
"supabase"
]
}
17 changes: 17 additions & 0 deletions npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "supabase-linux-arm64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"files": [
"supabase"
]
}
14 changes: 14 additions & 0 deletions npm/windows-amd64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "supabase-windows-amd64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"win32"
],
"cpu": [
"x64"
],
"files": [
"supabase.exe"
]
}
14 changes: 14 additions & 0 deletions npm/windows-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "supabase-windows-arm64",
"version": "0.0.0-automated",
"license": "MIT",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"files": [
"supabase.exe"
]
}
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
"files": [
"scripts"
],
"scripts": {
"postinstall": "node scripts/postinstall.js"
},
"bin": {
"supabase": "bin/supabase"
"supabase": "scripts/bin.js"
},
"dependencies": {
"bin-links": "^6.0.0",
"https-proxy-agent": "^7.0.2",
"node-fetch": "^3.3.2",
"tar": "7.5.2"
"optionalDependencies": {
"supabase-darwin-amd64": "0.0.0-automated",
"supabase-darwin-arm64": "0.0.0-automated",
"supabase-linux-amd64": "0.0.0-automated",
"supabase-linux-arm64": "0.0.0-automated",
"supabase-windows-amd64": "0.0.0-automated",
"supabase-windows-arm64": "0.0.0-automated"
},
"release": {
"branches": [
Expand All @@ -42,4 +41,4 @@
"@semantic-release/git"
]
}
}
}
25 changes: 21 additions & 4 deletions pkg/api/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading