-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.64 KB
/
update_versions.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
46
47
48
49
50
51
52
name: Update versions
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.PAT }}
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Run
id: run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 update_versions.py
echo $(cat versions.json)
git add versions.json
if git diff --cached --exit-code; then
echo "Nothing changed"
echo "release=false" >> $GITHUB_OUTPUT
else
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
version=$(date +'%Y%m%d-%H%M')
git commit -m "chore: bump versions $version"
git tag $version
git push origin master --tags
echo "[ghcr.io/${{ github.repository }}:$version](https://ghcr.io/${{ github.repository }}) Built using: $(jq -r 'to_entries | map("\n- \(.key): \(.value)") | .[]' versions.json)" > notes.txt
echo "release=true" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
fi
- name: Release
if: ${{ steps.run.outputs.release == 'true' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.run.outputs.version }}
name: ${{ steps.run.outputs.version }}
body_path: notes.txt