Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support new release archive name #112

Merged
merged 2 commits into from
Jan 4, 2023
Merged
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
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A specific version of the `supabase` CLI can be installed:
steps:
- uses: supabase/setup-cli@v1
with:
version: 1.16.1
version: 1.28.0
```

Run `supabase db start` to execute all migrations on a fresh database:
Expand All @@ -33,7 +33,7 @@ Run `supabase db start` to execute all migrations on a fresh database:
steps:
- uses: supabase/setup-cli@v1
with:
version: 1.16.1
version: latest
- run: supabase init
- run: supabase db start
```
Expand All @@ -44,7 +44,9 @@ Since Supabase CLI relies on Docker Engine API, additional setup may be required

The actions supports the following inputs:

- `version`: The version of `supabase` to install, defaulting to `1.0.0`. You can also specify `latest` to use the latest version.
| Name | Type | Description | Default | Required |
| --------- | ------ | ---------------------------------- | -------- | -------- |
| `version` | String | Supabase CLI version (or `latest`) | `1.28.0` | false |

## Advanced Usage

Expand Down Expand Up @@ -134,7 +136,7 @@ You can now validate the action by referencing `./` in a workflow in your repo (
```yaml
uses: ./
with:
version: 1.16.1
version: latest
```

See the [actions tab](https://github.com/actions/typescript-action/actions) for runs of this action! :rocket:
24 changes: 19 additions & 5 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@ import * as path from 'path'
import {expect, test} from '@jest/globals'

test('gets download url to binary', async () => {
const url = await getDownloadUrl('1.28.0')
expect(
url.startsWith(
'https://github.com/supabase/cli/releases/download/v1.28.0/supabase_'
)
).toBeTruthy()
expect(url.endsWith('.tar.gz')).toBeTruthy()
expect(url).not.toContain('_1.28.0_')
})

test('gets legacy download url to binary', async () => {
const url = await getDownloadUrl('0.1.0')
expect(url).toContain(
'https://github.com/supabase/cli/releases/download/v0.1.0/'
)
expect(
url.startsWith(
`https://github.com/supabase/cli/releases/download/v0.1.0/supabase_0.1.0_`
)
).toBeTruthy()
expect(url.endsWith('.tar.gz')).toBeTruthy()
})

test('gets download url to binary with "latest" version', async () => {
test('gets download url to latest version', async () => {
const url = await getDownloadUrl('latest')
expect(url).toMatch(
/^https:\/\/github.com\/supabase\/cli\/releases\/download\/v[0-9]+\.[0-9]+\.[0-9]+\/supabase_[0-9]+\.[0-9]+\.[0-9]+/
'https://github.com/supabase/cli/releases/latest/download/'
)
})

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
version:
description: Version of Supabase CLI to install
required: false
default: 1.0.0
default: 1.28.0
runs:
using: node16
main: dist/index.js
Loading