Debian Codegraph @

.github/workflows/build-data.yml

raw symbols SCIP
1 name: Build latest IANA data
2
3 on:
4 workflow_dispatch:
5
6 jobs:
7 build-data:
8 name: Fetch and build latest data from IANA
9 runs-on: ubuntu-latest
10
11 steps:
12 - uses: actions/checkout@v4
13
14 - name: Use Node.js
15 uses: actions/setup-node@v4
16 with:
17 node-version: lts/*
18 cache: npm
19
20 - name: Install dependencies
21 run: npm ci
22
23 # This differs slightly from the default `grunt data` flow. We want to explicitly compile
24 # `zic` and `zdump` to avoid relying on whatever version is on the action runners.
25 - name: Download tzdata and tzcode
26 run: |
27 npx grunt --verbose clean data-download
28 npx grunt --verbose data-download --fetch-tzcode
29
30 - name: Build zic and zdump
31 run: |
32 pushd temp/download/latest
33 make clean
34 make
35 popd
36
37 - name: Generate new data
38 run: |
39 npx grunt --verbose data-meta \
40 data-zic --zic-path=./temp/download/latest/zic \
41 data-zdump --zdump-path=./temp/download/latest/zdump \
42 data-collect \
43 data-dedupe \
44 data-pack \
45 data-tests
46
47 # The PR-specific workflow doesn't seem to run for PRs created by other workflows,
48 # so we run the tests manually here just in case
49 - name: Run tests
50 run: npm test
51 # Create a PR even if tests fail, so the branch can be pulled down locally to debug errors
52 continue-on-error: true
53
54 # Prepare version metadata for use in PR creation
55 - name: Prepare metadata
56 id: meta
57 run: |
58 echo "TZDATA_VERSION=$(cat temp/download/latest/version)" >> "$GITHUB_OUTPUT"
59 echo -e "This contains the following changes from tzdb (edit this to remove details irrelevant to this project):\n\n\`\`\`" > temp/pr-body.txt
60 awk '/^Release [[:digit:]]{4}/ {\
61 if (used != 1) { used = 1; active = 1 }\
62 else { active = 0 }\
63 } { if (active == 1) print }' \
64 temp/download/latest/NEWS >> temp/pr-body.txt
65 echo "\`\`\`" >> temp/pr-body.txt
66
67 - name: Create pull request
68 uses: peter-evans/create-pull-request@v6
69 with:
70 author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
71 branch: automated/data-update
72 commit-message: 'data: Add ${{ steps.meta.outputs.TZDATA_VERSION }}'
73 title: 'data: Add ${{ steps.meta.outputs.TZDATA_VERSION }}'
74 body-path: temp/pr-body.txt
75 reviewers: ${{ github.actor }}