-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (36 loc) · 1.67 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Update
on:
workflow_dispatch:
schedule:
- cron: '0 7 * * *'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch release version
run: |
VERSION_RELEASE=$(curl -s https://www.synology.com/en-global/releaseNote/SynologyDriveClient | grep -oPm1 'Version: \K[\d.]+-\d+')
VERSION=$(echo $VERSION_RELEASE | cut -d'-' -f1)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
RELEASE=$(echo $VERSION_RELEASE | cut -d'-' -f2)
echo "RELEASE=$RELEASE" >> "$GITHUB_ENV"
- name: Modify files
run: |
sed -i "s@^%global synology_version .*@%global synology_version $VERSION@" synology-drive{,-noextra}.spec
sed -i "s@^%global synology_release .*@%global synology_release $RELEASE@" synology-drive{,-noextra}.spec
if [ ! -z "$(git status -s)" ]; then
sed -i "/%changelog/a * $(date '+%a %b %d %Y') Maxime Dirksen <[email protected]> - $VERSION-$RELEASE\n- Version $VERSION-$RELEASE of Synology Drive Client" synology-drive{,-noextra}.spec
fi
- name: Create PR
uses: peter-evans/create-pull-request@v5
with:
title: "build(deps): update to ${{ env.VERSION }}-${{ env.RELEASE }}"
branch: "v${{ env.VERSION }}-${{ env.RELEASE }}"
commit-message: "chore(deps): update to ${{ env.VERSION }}-${{ env.RELEASE }}"
body: |
Update to ${{ env.VERSION }}-${{ env.RELEASE }}.
This PR has been created automatically.
assignees: "EmixamPP"
labels: dependencies
delete-branch: true