add t3 code pkg
This commit is contained in:
@@ -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 <<EOF
|
||||
automated update of t3code appimage version and hash
|
||||
|
||||
## changelog
|
||||
from \`${previous_version}\` to \`${version}\`
|
||||
|
||||
upstream release: ${release_url}
|
||||
EOF
|
||||
)
|
||||
|
||||
GITEA_API="https://gitea.unrail.xyz/api/v1/repos/thomas/nixos-config" \
|
||||
BRANCH="bot/t3code-${version}" \
|
||||
TITLE="update t3code to ${version}" \
|
||||
BODY="$pr_body" \
|
||||
bash .gitea/scripts/create-gitea-pr.sh
|
||||
Reference in New Issue
Block a user