diff --git a/.gitea/workflows/t3code-update.yml b/.gitea/workflows/t3code-update.yml new file mode 100644 index 0000000..43db10d --- /dev/null +++ b/.gitea/workflows/t3code-update.yml @@ -0,0 +1,70 @@ +name: t3code update + +on: + schedule: + - cron: "50 6 * * *" + workflow_dispatch: + +jobs: + update-t3code: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: install nix + uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: check latest t3code release and update file + id: update + env: + FILE: modules/pkgs/t3code.nix + LATEST_RELEASE_URL: https://github.com/pingdotgg/t3code/releases/latest + DOWNLOAD_URL_TEMPLATE: https://github.com/pingdotgg/t3code/releases/download/v{version}/T3-Code-{version}-x86_64.AppImage + RELEASE_TAG_TEMPLATE: v{version} + shell: bash + run: bash .gitea/scripts/update-appimage-nix.sh + + - name: create branch and commit + if: steps.update.outputs.updated == 'true' + shell: bash + run: | + set -euo pipefail + version="${{ steps.update.outputs.version }}" + + BRANCH="bot/t3code-${version}" \ + FILE="modules/pkgs/t3code.nix" \ + COMMIT_MESSAGE="update t3code to ${version}" \ + bash .gitea/scripts/commit-update.sh + + - name: open pull request + if: steps.update.outputs.updated == 'true' + env: + GITEA_TOKEN: ${{ secrets.tea_token || secrets.TEA_TOKEN }} + shell: bash + run: | + set -euo pipefail + + version="${{ steps.update.outputs.version }}" + previous_version="${{ steps.update.outputs.previous_version }}" + release_url="${{ steps.update.outputs.release_url }}" + + pr_body=$(cat <