Skip to content

Commit

Permalink
Switch time zone data to global-tz
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Mar 20, 2022
1 parent 82fea10 commit 3950bdc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/tzdbupdate.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: TZDB check

on:
push:
branches:
- 'master'
schedule:
- cron: '0 3 * * 1,2,3,5'
- cron: '50 1 * * *'

jobs:
tzdbcheck:
Expand All @@ -13,6 +16,7 @@ jobs:
uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_TOKEN_GH }}

- name: Maven cache
uses: actions/cache@v1
with:
Expand All @@ -25,6 +29,7 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Maven version
run: |
mkdir -p ./.mvn
Expand All @@ -37,14 +42,17 @@ jobs:
CURRENT_TZDB=$(mvn help:evaluate -Dexpression=tz.database.version -q -DforceStdout)
echo "current: $CURRENT_TZDB"
echo "CURRENT_TZDB=$CURRENT_TZDB" >> $GITHUB_ENV
- name: Get latest version
working-directory: target
run: |
git clone https://github.com/JodaOrg/tz.git
git clone https://github.com/JodaOrg/global-tz.git tz
cd tz
git checkout global-tz
LATEST_TZDB=$(git describe --abbrev=0 --tags)
echo "latest: $LATEST_TZDB"
echo "LATEST_TZDB=$LATEST_TZDB" >> $GITHUB_ENV
- name: Compare versions
run: |
echo "current: $CURRENT_TZDB"
Expand All @@ -55,19 +63,22 @@ jobs:
if: env.NOOP != 'true'
run: |
mvn install site
- name: Make
if: env.NOOP != 'true'
working-directory: target/tz
run: |
git checkout main
git checkout global-tz
git reset --hard ${LATEST_TZDB} --
git status
make rearguard_tarballs
- name: Copy rearguard files
if: env.NOOP != 'true'
run: |
mkdir -p src/tzdb/${LATEST_TZDB}
cp -r target/tz/tzdata${LATEST_TZDB}-rearguard.dir/. src/tzdb/${LATEST_TZDB}
- name: Update build with new tzdb
if: env.NOOP != 'true'
run: |
Expand All @@ -82,11 +93,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN_GH }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Update TZDB to ${{ env.LATEST_TZDB }}'
commit-message: 'Update time zone data to ${{ env.LATEST_TZDB }}'
committer: Stephen Colebourne (CI) <scolebourne@joda.org>
author: Stephen Colebourne (CI) <scolebourne@joda.org>
title: 'Update TZDB to ${{ env.LATEST_TZDB }}'
body: 'Updates TZDB data to ${{ env.LATEST_TZDB }}'
title: 'Update time zone data to ${{ env.LATEST_TZDB }}'
body: 'Update time zone data to ${{ env.LATEST_TZDB }}'
assignees: jodastephen
labels: TZDB
branch: bot/update-tzdb
22 changes: 10 additions & 12 deletions src/site/markdown/update-tzdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ The first option is to build a standalone tzdb file.
The generated jar file is added to the classpath in addition to the standard threetenbp.jar file.

1. Clone the [source repository](https://github.com/ThreeTen/threetenbp) from GitHub
2. [Download](https://www.iana.org/time-zones) the latest tzdb from IANA
3. Run make `rearguard_tarballs` to obtain the corrected input data files
4. Copy the corrected rearguard files from `tzdata{tzdb-version}-rearguard.dir` to the folder `src/tzdb/{tzdb-version}` inside the cloned source
5. Run the maven command `mvn clean package -Dtzdb-jar`
6. Add the resulting tzdb-{version}.jar file in the `target` folder to your classpath
2. [Download](https://github.com/JodaOrg/global-tz/releases) the latest rearguard time zone data
3. Extract and copy the rearguard files from `tzdata{tzdb-version}-rearguard.dir` to the folder `src/tzdb/{tzdb-version}` inside the threetenbp source
4. Run the maven command `mvn clean package -Dtzdb-jar`
5. Add the resulting tzdb-{version}.jar file in the `target` folder to your classpath
(ignore the tadb-all.jar file)

This is the preferred approach as it separates the tzdb data from released code.
Expand All @@ -27,10 +26,9 @@ The second option is to rebuild the main threetenbp.jar file.
The generated jar file will replace the standard threetenbp.jar file.

1. Clone the [source repository](https://github.com/ThreeTen/threetenbp) from GitHub
2. [Download](https://www.iana.org/time-zones) the latest tzdb from IANA
3. Run make `rearguard_tarballs` to obtain the corrected input data files
4. Copy the corrected rearguard files from `tzdata{tzdb-version}-rearguard.dir` to the folder `src/tzdb/{tzdb-version}` inside the cloned source
5. Change the version number in the maven pom to indicate it is your unoffical build
6. Run the maven command `mvn clean compile`
7. Run the maven command `mvn package -Dtzdb-update`
8. Use the resulting threetenbp.jar file in the `target` folder
2. [Download](https://github.com/JodaOrg/global-tz/releases) the latest rearguard time zone data
3. Extract and copy the rearguard files from `tzdata{tzdb-version}-rearguard.dir` to the folder `src/tzdb/{tzdb-version}` inside the threetenbp source
4. Change the version number in the maven pom to indicate it is your unoffical build
5. Run the maven command `mvn clean compile`
6. Run the maven command `mvn package -Dtzdb-update`
7. Use the resulting threetenbp.jar file in the `target` folder

0 comments on commit 3950bdc

Please # to comment.