76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: helium update
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 6 * * *"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-helium:
|
|
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 helium release and update file
|
|
id: update
|
|
env:
|
|
FILE: modules/pkgs/helium.nix
|
|
LATEST_RELEASE_URL: https://github.com/imputnet/helium-linux/releases/latest
|
|
DOWNLOAD_URL_TEMPLATE: https://github.com/imputnet/helium-linux/releases/download/{version}/helium-{version}-x86_64.AppImage
|
|
RELEASE_API_REPO: imputnet/helium-linux
|
|
RELEASE_TAG_TEMPLATE: '{version}'
|
|
GITHUB_TOKEN: ${{ secrets.github_token || secrets.GITHUB_TOKEN }}
|
|
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/helium-${version}" \
|
|
FILE="modules/pkgs/helium.nix" \
|
|
COMMIT_MESSAGE="update helium 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 }}
|
|
CHANGELOG: ${{ steps.update.outputs.changelog }}
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
version="${{ steps.update.outputs.version }}"
|
|
previous_version="${{ steps.update.outputs.previous_version }}"
|
|
release_url="https://github.com/imputnet/helium-linux/releases/tag/${version}"
|
|
|
|
pr_body=$(cat <<EOF
|
|
automated update of helium appimage version and hash
|
|
|
|
## changelog
|
|
from \`${previous_version}\` to \`${version}\`
|
|
|
|
upstream release: ${release_url}
|
|
|
|
${CHANGELOG}
|
|
EOF
|
|
)
|
|
|
|
GITEA_API="https://gitea.unrail.xyz/api/v1/repos/thomas/nixos-config" \
|
|
BRANCH="bot/helium-${version}" \
|
|
TITLE="update helium to ${version}" \
|
|
BODY="$pr_body" \
|
|
bash .gitea/scripts/create-gitea-pr.sh
|