Add an update workflow?

This commit is contained in:
Simonas Kazlauskas
2023-07-30 15:51:09 +03:00
parent 8950cd5316
commit e57e624f16
3 changed files with 40 additions and 1 deletions

31
.github/workflows/update.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Update the version
on:
workflow_dispatch:
schedule:
- cron: '39 0/6 * * *'
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix-shell update.sh
id: update
- if: ${{ steps.update.outputs.changed }}
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- if: ${{ steps.update.outputs.changed }}
name: Create Pull Request
uses: peter-evans/create-pull-request@d9d6fd980e1e0904e8e4dce3f0992640091bde37
with:
title: "Update package to ${{ steps.update.outputs.version }}"
body: ''
delete-branch: true
token: ${{ steps.generate-token.outputs.token }}
base: main

View File

@@ -18,3 +18,12 @@ curl -L https://github.com/openhab/openhab-distro/releases/download/"$MOST_RECEN
| cut -d" " -f1 \
| tr -d '\n' \
> openhab-addons.sha256
if ! git diff --quiet "version"; then
if [[ -v GITHUB_OUTPUT ]]; then
echo "version=$MOST_RECENT" >> $GITHUB_OUTPUT
echo "changed=true" >> $GITHUB_OUTPUT
fi
else
exit 0
fi

View File

@@ -1 +0,0 @@
4.0.1