-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 2.24 KB
/
update_tzdb.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
53
54
55
56
57
58
59
60
61
62
63
64
name: TZDB version update
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1,4'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- id: current-tzdb-version
run: |
echo 'tzdb-version=$(grep "ianaVersion" "tzdb_version.properties" | cut -d'=' -f2)' >> $GITHUB_OUTPUT
- id: latest-tzdb-version
run: |
wget -q https://data.iana.org/time-zones/tzdata-latest.tar.gz
tar -xf tzdata-latest.tar.gz version
LATEST_VERSION=$(cat version)
echo "tzdb-version=$LATEST_VERSION" >> $GITHUB_OUTPUT
rm tzdata-latest.tar.gz
rm version
- id: should-run
run: |
echo "Current version is >>${{ steps.current-tzdb-version.outputs.tzdb-version }}<<"
echo "Latest versions is >>${{ steps.latest-tzdb-version.outputs.tzdb-version }}<<"
if [ "${{ steps.current-tzdb-version.outputs.tzdb-version }}" != "${{ steps.latest-tzdb-version.outputs.tzdb-version }}" ];
then
echo 'version-changed=true' >> $GITHUB_OUTPUT
fi
- uses: gradle/actions/setup-gradle@v4
if: steps.should-run.outputs.version-changed
- run: ./gradlew generateLazyZoneRules -Plazythreetenbp.tzdbVersion=${{ steps.latest-tzdb-version.outputs.tzdb-version }}
if: steps.should-run.outputs.version-changed
- run: git status
- name: Create Pull Request
if: steps.should-run.outputs.version-changed
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PUBLIC_REPO_TOKEN }}
commit-message: "Update TZDB to ${{ steps.latest-tzdb-version.outputs.tzdb-version }}"
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
delete-branch: true
title: "Update TZDB to ${{ steps.latest-tzdb-version.outputs.tzdb-version }}"
body: |
Update TZDB to **${{ steps.latest-tzdb-version.outputs.tzdb-version }}**
Details: https://www.iana.org/time-zones