From 234d31220e78b7dfe6e902167b845067f40e6e4c Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Sat, 6 Aug 2022 02:27:39 +0800 Subject: [PATCH] Update readme and default version (#10) --- .github/workflows/test.yml | 2 +- CODEOWNERS | 2 +- README.md | 48 +++++++++++++++++++++++++++++++++++--- __tests__/main.test.ts | 2 +- action.yml | 2 +- 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 742011d..7c7b926 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] - version: [0.32.1, 0.32.0] + version: [0.32.1, 0.34.2] steps: - uses: actions/checkout@v3 - uses: ./ diff --git a/CODEOWNERS b/CODEOWNERS index 992d27f..87cbf04 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @actions/actions-runtime +* @soedirgo @sweatybridge diff --git a/README.md b/README.md index 91314bc..299a6dc 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,56 @@ A specific version of the `supabase` CLI can be installed: steps: - uses: supabase/setup-cli@v1 with: - version: 0.32.1 + version: 0.34.2 ``` +Run `supabase start` to execute all migrations on a fresh database: + +```yaml +steps: + - uses: supabase/setup-cli@v1 + with: + version: 0.34.2 + - run: supabase init + - run: supabase start +``` + +Since Supabase CLI relies on Docker Engine API, additional setup may be required on Windows and macOS runners. + ## Inputs The actions supports the following inputs: -- `version`: The version of `supabase` to install, defaulting to `0.32.1` +- `version`: The version of `supabase` to install, defaulting to `0.34.2` + +## Advanced Usage + +Check generated TypeScript types are up-to-date with Postgres schema: + +```yaml +steps: + - uses: supabase/setup-cli@v1 + - run: supabase init + - run: supabase start + - name: Verify generated types match Postgres schema + run: | + supabase gen types typescript --local > schema.gen.ts + if [ "$(git diff --ignore-space-at-eol schema.gen.ts | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi +``` + +Release job to push schema changes to a Supabase project: + +```yaml +steps: + - uses: supabase/setup-cli@v1 + - run: supabase init + - run: supabase db remote set ${{ secrets.DB_URL }} + - run: supabase db push +``` ## Develop @@ -87,7 +129,7 @@ You can now validate the action by referencing `./` in a workflow in your repo ( ```yaml uses: ./ with: - version: 0.32.1 + version: 0.34.2 ``` See the [actions tab](https://github.com/actions/typescript-action/actions) for runs of this action! :rocket: diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index b74ffa2..192a112 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -15,7 +15,7 @@ test('gets download url to binary', async () => { // shows how the runner will run a javascript action with env / stdout protocol test('test runs', () => { process.env['RUNNER_TEMP'] = os.tmpdir() - process.env['INPUT_VERSION'] = '0.32.1' + process.env['INPUT_VERSION'] = '0.34.2' const np = process.execPath const ip = path.join(__dirname, '..', 'lib', 'main.js') const options: cp.ExecFileSyncOptions = { diff --git a/action.yml b/action.yml index ad622a7..a41572e 100644 --- a/action.yml +++ b/action.yml @@ -5,7 +5,7 @@ inputs: version: description: Version of Supabase CLI to install required: false - default: 0.32.1 + default: 0.34.2 runs: using: node16 main: dist/index.js