forked from stardew-valley-dedicated-server/server
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (136 loc) · 7.73 KB
/
dependabot-dockerfile.yml
File metadata and controls
163 lines (136 loc) · 7.73 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: "Dependabot: Dockerfile"
on:
schedule:
- cron: "0 0 * * 1" # Weekly on Monday at midnight UTC
workflow_dispatch: # Allow manual trigger
permissions: {}
jobs:
update-dockerfile-deps:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check for SMAPI updates
id: smapi
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get current version from Dockerfile
CURRENT_VERSION=$(grep -oP 'ARG SMAPI_VERSION=\K[0-9.]+' docker/Dockerfile)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
# Get latest release from GitHub API (excluding pre-releases)
LATEST_VERSION=$(gh api repos/Pathoschild/SMAPI/releases --jq '[.[] | select(.prerelease == false)][0].tag_name')
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
# Compare versions
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
echo "update_available=true" >> $GITHUB_OUTPUT
echo "SMAPI update available: $CURRENT_VERSION -> $LATEST_VERSION"
else
echo "update_available=false" >> $GITHUB_OUTPUT
echo "SMAPI is up to date: $CURRENT_VERSION"
fi
- name: Check for tmux updates
id: tmux
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get current version from Dockerfile (e.g., "3.6a" from the URL)
CURRENT_VERSION=$(grep -oP 'tmux-builds/releases/download/v\K[0-9.a-z]+' docker/Dockerfile | head -1)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
# Get latest release from GitHub API
LATEST_VERSION=$(gh api repos/tmux/tmux-builds/releases/latest --jq '.tag_name | ltrimstr("v")')
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
# Compare versions
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
echo "update_available=true" >> $GITHUB_OUTPUT
echo "tmux update available: $CURRENT_VERSION -> $LATEST_VERSION"
else
echo "update_available=false" >> $GITHUB_OUTPUT
echo "tmux is up to date: $CURRENT_VERSION"
fi
- name: Check for Bun updates
id: bun
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get current version from Dockerfile
CURRENT_VERSION=$(grep -oP 'oven/bun:\K[0-9.]+' tools/discord-bot/Dockerfile | head -1)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
# Get latest release from GitHub API
LATEST_VERSION=$(gh api repos/oven-sh/bun/releases/latest --jq '.tag_name | ltrimstr("bun-v")')
echo "latest_version=$LATEST_VERSION" >> $GITHUB_OUTPUT
# Compare versions
if [ "$CURRENT_VERSION" != "$LATEST_VERSION" ]; then
echo "update_available=true" >> $GITHUB_OUTPUT
echo "Bun update available: $CURRENT_VERSION -> $LATEST_VERSION"
else
echo "update_available=false" >> $GITHUB_OUTPUT
echo "Bun is up to date: $CURRENT_VERSION"
fi
- name: Update SMAPI in Dockerfile
if: steps.smapi.outputs.update_available == 'true'
run: |
sed -i "s/ARG SMAPI_VERSION=${{ steps.smapi.outputs.current_version }}/ARG SMAPI_VERSION=${{ steps.smapi.outputs.latest_version }}/" docker/Dockerfile
- name: Create SMAPI Pull Request
if: steps.smapi.outputs.update_available == 'true'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(deps): bump SMAPI from ${{ steps.smapi.outputs.current_version }} to ${{ steps.smapi.outputs.latest_version }}"
title: "chore(deps): bump SMAPI from ${{ steps.smapi.outputs.current_version }} to ${{ steps.smapi.outputs.latest_version }}"
body: |
Bumps [SMAPI](https://github.com/Pathoschild/SMAPI) from ${{ steps.smapi.outputs.current_version }} to ${{ steps.smapi.outputs.latest_version }}.
Release notes: https://github.com/Pathoschild/SMAPI/releases/tag/${{ steps.smapi.outputs.latest_version }}
---
This PR was automatically created by the [Dependabot: Dockerfile](${{ github.server_url }}/${{ github.repository }}/actions/workflows/dependabot-dockerfile.yml) workflow.
branch: deps/smapi-${{ steps.smapi.outputs.latest_version }}
labels: dependencies
delete-branch: true
- name: Reset working directory
if: steps.smapi.outputs.update_available == 'true'
run: git checkout -- .
- name: Update tmux in Dockerfile
if: steps.tmux.outputs.update_available == 'true'
run: |
sed -i "s/tmux-${{ steps.tmux.outputs.current_version }}/tmux-${{ steps.tmux.outputs.latest_version }}/g" docker/Dockerfile
sed -i "s/download\/v${{ steps.tmux.outputs.current_version }}/download\/v${{ steps.tmux.outputs.latest_version }}/g" docker/Dockerfile
- name: Create tmux Pull Request
if: steps.tmux.outputs.update_available == 'true'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(deps): bump tmux from ${{ steps.tmux.outputs.current_version }} to ${{ steps.tmux.outputs.latest_version }}"
title: "chore(deps): bump tmux from ${{ steps.tmux.outputs.current_version }} to ${{ steps.tmux.outputs.latest_version }}"
body: |
Bumps [tmux](https://github.com/tmux/tmux) from ${{ steps.tmux.outputs.current_version }} to ${{ steps.tmux.outputs.latest_version }}.
Release notes: https://github.com/tmux/tmux-builds/releases/tag/v${{ steps.tmux.outputs.latest_version }}
---
This PR was automatically created by the [Dependabot: Dockerfile](${{ github.server_url }}/${{ github.repository }}/actions/workflows/dependabot-dockerfile.yml) workflow.
branch: deps/tmux-${{ steps.tmux.outputs.latest_version }}
labels: dependencies
delete-branch: true
- name: Reset working directory
if: steps.tmux.outputs.update_available == 'true'
run: git checkout -- .
- name: Update Bun in Dockerfile
if: steps.bun.outputs.update_available == 'true'
run: |
sed -i "s/oven\/bun:${{ steps.bun.outputs.current_version }}/oven\/bun:${{ steps.bun.outputs.latest_version }}/g" tools/discord-bot/Dockerfile
- name: Create Bun Pull Request
if: steps.bun.outputs.update_available == 'true'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(deps): bump Bun from ${{ steps.bun.outputs.current_version }} to ${{ steps.bun.outputs.latest_version }}"
title: "chore(deps): bump Bun from ${{ steps.bun.outputs.current_version }} to ${{ steps.bun.outputs.latest_version }}"
body: |
Bumps [Bun](https://github.com/oven-sh/bun) from ${{ steps.bun.outputs.current_version }} to ${{ steps.bun.outputs.latest_version }}.
Release notes: https://github.com/oven-sh/bun/releases/tag/bun-v${{ steps.bun.outputs.latest_version }}
---
This PR was automatically created by the [Dependabot: Dockerfile](${{ github.server_url }}/${{ github.repository }}/actions/workflows/dependabot-dockerfile.yml) workflow.
branch: deps/bun-${{ steps.bun.outputs.latest_version }}
labels: dependencies
delete-branch: true