Skip to content

TZDB version update #309

TZDB version update

TZDB version update #309

Workflow file for this run

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