diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff19689..a4a0202 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -619,12 +619,12 @@ jobs: token: ${{ secrets.WINGET_GITHUB_TOKEN }} # ── Update Scoop bucket ────────────────────────────────────────────── - # Pushes an updated Scoop manifest to the vmvarela/scoop-sql-pipe - # bucket repository so Windows users can install via: - # scoop bucket add sql-pipe https://github.com/vmvarela/scoop-sql-pipe + # Pushes an updated Scoop manifest to the vmvarela/scoop-bucket + # centralized bucket repository so Windows users can install via: + # scoop bucket add vmvarela https://github.com/vmvarela/scoop-bucket # scoop install sql-pipe # Requires: - # 1. Repository: vmvarela/scoop-sql-pipe (with sql-pipe.json at root) + # 1. Repository: vmvarela/scoop-bucket (with bucket/sql-pipe.json) # 2. Secret: SCOOP_BUCKET_TOKEN (PAT with contents:write on the bucket repo) update-scoop: name: Update Scoop bucket @@ -695,12 +695,13 @@ jobs: echo "==> Generated Scoop manifest for sql-pipe ${VERSION}:" cat sql-pipe.json - git clone "https://x-access-token:${SCOOP_BUCKET_TOKEN}@github.com/vmvarela/scoop-sql-pipe.git" bucket - cp sql-pipe.json bucket/sql-pipe.json - cd bucket + git clone "https://x-access-token:${SCOOP_BUCKET_TOKEN}@github.com/vmvarela/scoop-bucket.git" scoop-repo + mkdir -p scoop-repo/bucket + cp sql-pipe.json scoop-repo/bucket/sql-pipe.json + cd scoop-repo git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add sql-pipe.json + git add bucket/sql-pipe.json git diff --cached --quiet || git commit -m "sql-pipe ${VERSION}" git push @@ -746,39 +747,42 @@ jobs: --clobber # ── Update Nix package versions ──────────────────────────────────── - # Updates packaging/nix/versions.json with the new release hashes and - # opens a Pull Request so `nix run github:vmvarela/sql-pipe` always - # points to the latest version. + # Pushes updated pkgs/sql-pipe/versions.json directly to + # vmvarela/nix-packages so `nix run github:vmvarela/nix-packages#sql-pipe` + # always points to the latest release. + # Requires: + # 1. Repository: vmvarela/nix-packages + # 2. Secret: NIX_PACKAGES_TOKEN (PAT with contents:write on vmvarela/nix-packages) update-nix: name: Update Nix package needs: checksums runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write + env: + HAS_NIX_TOKEN: ${{ secrets.NIX_PACKAGES_TOKEN != '' }} steps: - - uses: actions/checkout@v6 - with: - ref: master - - - name: Update versions.json + - name: Download sha256sums.txt + if: ${{ env.HAS_NIX_TOKEN == 'true' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - VERSION="${GITHUB_REF_NAME#v}" - - # Download the checksums file generated by the previous job gh release download "${{ github.ref_name }}" \ --repo "${{ github.repository }}" \ --pattern sha256sums.txt \ --dir . - SHA_X64_LINUX=$(awk '$2 == "sql-pipe-x86_64-linux" { print $1 }' sha256sums.txt) - SHA_A64_LINUX=$(awk '$2 == "sql-pipe-aarch64-linux" { print $1 }' sha256sums.txt) - SHA_X64_MACOS=$(awk '$2 == "sql-pipe-x86_64-macos" { print $1 }' sha256sums.txt) - SHA_A64_MACOS=$(awk '$2 == "sql-pipe-aarch64-macos" { print $1 }' sha256sums.txt) + - name: Push updated versions.json to nix-packages + if: ${{ env.HAS_NIX_TOKEN == 'true' }} + env: + NIX_PACKAGES_TOKEN: ${{ secrets.NIX_PACKAGES_TOKEN }} + run: | + VERSION="${GITHUB_REF_NAME#v}" - cat > packaging/nix/versions.json < versions.json < Updated Nix versions.json for sql-pipe ${VERSION}:" - cat packaging/nix/versions.json + cat versions.json - - name: Open Pull Request - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - BRANCH="chore/nix-update-${{ github.ref_name }}" + git clone \ + "https://x-access-token:${NIX_PACKAGES_TOKEN}@github.com/vmvarela/nix-packages.git" \ + nix-repo + cp versions.json nix-repo/pkgs/sql-pipe/versions.json + cd nix-repo git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b "${BRANCH}" - git add packaging/nix/versions.json + git add pkgs/sql-pipe/versions.json git diff --cached --quiet && echo "No changes to commit." && exit 0 - git commit -m "chore(nix): update versions.json to ${{ github.ref_name }}" - git push origin "${BRANCH}" - gh pr create \ - --base master \ - --head "${BRANCH}" \ - --title "chore(nix): update versions.json to ${{ github.ref_name }}" \ - --body "Automated update of \`packaging/nix/versions.json\` hashes for release \`${{ github.ref_name }}\`." \ - --label "type:chore" + git commit -m "chore(sql-pipe): update to ${{ github.ref_name }}" + git push + + # ── Update APT repository ────────────────────────────────────────── + # Dispatches to vmvarela/apt-packages which rebuilds the signed APT index + # and deploys to GitHub Pages so users can install via apt. + # Requires: + # 1. Repository: vmvarela/apt-packages (GitHub Pages enabled) + # 2. Secret: APT_PACKAGES_TOKEN (PAT with contents:write on vmvarela/apt-packages) + update-apt: + name: Update APT repository + needs: package-deb + if: >- + always() + && needs.package-deb.result == 'success' + runs-on: ubuntu-latest + env: + HAS_APT_TOKEN: ${{ secrets.APT_PACKAGES_TOKEN != '' }} + steps: + - name: Dispatch to apt-packages + if: ${{ env.HAS_APT_TOKEN == 'true' }} + env: + GH_TOKEN: ${{ secrets.APT_PACKAGES_TOKEN }} + run: | + VERSION="${GITHUB_REF_NAME#v}" + gh api repos/vmvarela/apt-packages/dispatches \ + --method POST \ + -f event_type=update-sql-pipe \ + -F client_payload[version]="${VERSION}" + echo "Dispatched update-sql-pipe v${VERSION} to vmvarela/apt-packages" + + # ── Update RPM repository ────────────────────────────────────────── + # Dispatches to vmvarela/rpm-packages which rebuilds the signed RPM index + # and deploys to GitHub Pages so users can install via dnf/yum. + # Requires: + # 1. Repository: vmvarela/rpm-packages (GitHub Pages enabled) + # 2. Secret: RPM_PACKAGES_TOKEN (PAT with contents:write on vmvarela/rpm-packages) + update-rpm: + name: Update RPM repository + needs: package-rpm + if: >- + always() + && needs.package-rpm.result == 'success' + runs-on: ubuntu-latest + env: + HAS_RPM_TOKEN: ${{ secrets.RPM_PACKAGES_TOKEN != '' }} + steps: + - name: Dispatch to rpm-packages + if: ${{ env.HAS_RPM_TOKEN == 'true' }} + env: + GH_TOKEN: ${{ secrets.RPM_PACKAGES_TOKEN }} + run: | + VERSION="${GITHUB_REF_NAME#v}" + gh api repos/vmvarela/rpm-packages/dispatches \ + --method POST \ + -f event_type=update-sql-pipe \ + -F client_payload[version]="${VERSION}" + echo "Dispatched update-sql-pipe v${VERSION} to vmvarela/rpm-packages" + + # ── Update APK repository ────────────────────────────────────────── + # Dispatches to vmvarela/apk-packages which rebuilds the signed APK index + # and deploys to GitHub Pages so Alpine Linux users can install via apk. + # Requires: + # 1. Repository: vmvarela/apk-packages (GitHub Pages enabled) + # 2. Secret: APK_PACKAGES_TOKEN (PAT with contents:write on vmvarela/apk-packages) + update-apk: + name: Update APK repository + needs: package-apk + if: >- + always() + && needs.package-apk.result == 'success' + runs-on: ubuntu-latest + env: + HAS_APK_TOKEN: ${{ secrets.APK_PACKAGES_TOKEN != '' }} + steps: + - name: Dispatch to apk-packages + if: ${{ env.HAS_APK_TOKEN == 'true' }} + env: + GH_TOKEN: ${{ secrets.APK_PACKAGES_TOKEN }} + run: | + VERSION="${GITHUB_REF_NAME#v}" + gh api repos/vmvarela/apk-packages/dispatches \ + --method POST \ + -f event_type=update-sql-pipe \ + -F client_payload[version]="${VERSION}" + echo "Dispatched update-sql-pipe v${VERSION} to vmvarela/apk-packages" diff --git a/README.md b/README.md index 5319199..4d13588 100644 --- a/README.md +++ b/README.md @@ -35,31 +35,57 @@ By default it installs to `/usr/local/bin`. Override with `INSTALL_DIR`: curl -sSL https://raw.githubusercontent.com/vmvarela/sql-pipe/master/install.sh | INSTALL_DIR="$HOME/.local/bin" sh ``` -**Debian / Ubuntu (.deb package):** +**Debian / Ubuntu (APT repository):** ```sh -wget https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe_VERSION_amd64.deb -sudo dpkg -i sql-pipe_VERSION_amd64.deb +curl -sSL https://vmvarela.github.io/apt-packages/key.gpg \ + | sudo tee /etc/apt/keyrings/vmvarela.asc +echo "deb [signed-by=/etc/apt/keyrings/vmvarela.asc] https://vmvarela.github.io/apt-packages stable main" \ + | sudo tee /etc/apt/sources.list.d/vmvarela.list +sudo apt update && sudo apt install sql-pipe ``` -Replace `VERSION` with the release version (e.g. `0.2.0`) and `amd64` with your architecture (`arm64`, `armhf`, or `386`). +Or install a single release asset directly: -**Fedora / RHEL / openSUSE (.rpm package):** +```sh +wget https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe_VERSION_linux_amd64.deb +sudo dpkg -i sql-pipe_VERSION_linux_amd64.deb +``` + +Replace `VERSION` with the release version (e.g. `0.3.0`) and `amd64` with your architecture (`arm64`, `arm7`, or `386`). + +**Fedora / RHEL / openSUSE (RPM repository):** + +```sh +sudo dnf config-manager --add-repo https://vmvarela.github.io/rpm-packages/vmvarela.repo +sudo dnf install sql-pipe +``` + +Or install a single release asset directly: ```sh -sudo rpm -i https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe-VERSION-1.x86_64.rpm +sudo rpm -i https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe_VERSION_linux_amd64.rpm ``` -Replace `VERSION` with the release version (e.g. `0.2.0`) and `x86_64` with your architecture (`aarch64`). +Replace `VERSION` with the release version (e.g. `0.3.0`) and `amd64` with your architecture (`arm64`). + +**Alpine Linux (APK repository):** + +```sh +wget -qO /etc/apk/keys/vmvarela.rsa.pub \ + https://vmvarela.github.io/apk-packages/vmvarela.rsa.pub +echo "https://vmvarela.github.io/apk-packages" >> /etc/apk/repositories +apk update && apk add sql-pipe +``` -**Alpine Linux (.apk package):** +Or install a single release asset directly: ```sh -wget https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe_VERSION_x86_64.apk -sudo apk add --allow-untrusted sql-pipe_VERSION_x86_64.apk +wget https://github.com/vmvarela/sql-pipe/releases/latest/download/sql-pipe_VERSION_linux_amd64.apk +sudo apk add --allow-untrusted sql-pipe_VERSION_linux_amd64.apk ``` -Replace `VERSION` with the release version (e.g. `0.2.0`) and `x86_64` with your architecture (`aarch64`). +Replace `VERSION` with the release version (e.g. `0.3.0`) and `amd64` with your architecture (`arm64`). **Arch Linux (AUR):** install with your preferred AUR helper: @@ -73,13 +99,13 @@ paru -S sql-pipe ```sh # Run without installing -nix run github:vmvarela/sql-pipe -- 'SELECT * FROM t' +nix run github:vmvarela/nix-packages#sql-pipe -- 'SELECT * FROM t' # Install to profile -nix profile install github:vmvarela/sql-pipe +nix profile install github:vmvarela/nix-packages#sql-pipe # Non-flake -nix-env -if https://github.com/vmvarela/sql-pipe/archive/master.tar.gz +nix-env -if https://github.com/vmvarela/nix-packages/archive/main.tar.gz ``` **Windows (Chocolatey):** @@ -97,7 +123,7 @@ winget install vmvarela.sql-pipe **Windows (Scoop):** ```powershell -scoop bucket add sql-pipe https://github.com/vmvarela/scoop-sql-pipe +scoop bucket add vmvarela https://github.com/vmvarela/scoop-bucket scoop install sql-pipe ```