Skip to content

Commit

Permalink
add auto-update stuff for packages, rename -> supabase-cli-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetrucciani committed Nov 14, 2024
1 parent bc7beec commit 4112ac5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/update_pkgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: check for package updates
on: { workflow_dispatch, schedule: [cron: '0 0 * * *'] }
jobs:
check-for-pkg-updates:
strategy:
fail-fast: false
matrix:
attrs:
- attr: fake-gcs-server
cmd: nupdate
- attr: supabase-cli-stable
cmd: nupdate_latest_github -- --owner supabase --repo cli
runs-on: ubuntu-24.04
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v30
- run: nix run .#${{ matrix.attrs.cmd }} ${{ matrix.attrs.attr }}
- uses: peter-evans/[email protected]
id: pr
with:
delete-branch: true
author: jacobi petrucciani <[email protected]>
title: automatic update (${{ matrix.attr.attr }})
commit-message: automatic update (${{ matrix.attr.attr }})
branch: automatic-update-${{ matrix.attr.attr }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- run: gh pr merge --auto --squash ${{ steps.pr.outputs.pull-request-url }}
19 changes: 18 additions & 1 deletion mods/pog/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,26 @@ rec {
arguments = [{ name = "attribute"; }];
description = "my lazy helper function to update an attribute in my nix repo";
script = ''
${prev.nix-update}/bin/nix-update --build --commit --flake --use-update-script "$@"
${prev.nix-update}/bin/nix-update --build --flake --use-update-script "$@"
'';
};

nupdate_latest_github = pog {
name = "nupdate_latest_github";
arguments = [{ name = "attribute"; }];
flags = [
{ name = "owner"; description = "the owner of the repo"; }
{ name = "repo"; description = "the repo name"; }
];
description = "";
script = ''
latest_tag=$(${final.curl}/bin/curl "https://api.github.com/repos/$owner/$repo/releases/latest" | ${final.jq}/bin/jq -r '.tag_name')
${prev.nix-update}/bin/nix-update --build --flake --version="$latest_tag" "$@"
'';
};

# get_latest = "${curl}/bin/curl https://api.github.com/repos/supabase/cli/releases/latest | ${jq}/bin/jq '.tag_name'";

ndiff = pog {
name = "ndiff";
arguments = [{ name = "attribute"; }];
Expand All @@ -273,6 +289,7 @@ rec {
nixsum
nixcache
nupdate
nupdate_latest_github
y2n
];
}
4 changes: 2 additions & 2 deletions pkgs/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ This directory contains cli tools

[slack-notifier](https://github.com/cloudposse/slack-notifier) is a cli util to send slack messages

### [supabase-cli-beta.nix](./supabase-cli-beta.nix)
### [supabase-cli-stable.nix](./supabase-cli-stable.nix)

[supabase-cli](https://github.com/supabase/cli) is the main CLI interface for [supabase](https://supabase.com)
[supabase-cli](https://github.com/supabase/cli) is the main CLI interface for [supabase](https://supabase.com). This is updated independently

### [terramaid.nix](./terramaid.nix)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
, supabase-cli
}:


buildGoModule rec {
pname = "supabase-cli-beta";
pname = "supabase-cli-stable";
version = "1.219.2";

src = fetchFromGitHub {
Expand Down

0 comments on commit 4112ac5

Please sign in to comment.