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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Rust
on:
push:
branches:
paths:
- "**/*.rs"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".cargo/**"
- "Makefile"
- "README.md"
- ".github/workflows/rust.yml"
pull_request:
branches:
paths:
- "**/*.rs"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- ".cargo/**"
- "Makefile"
- "README.md"
- ".github/workflows/rust.yml"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Sibling checkouts backing the Cargo path dependency on ../tzf-dist.
# Interim wiring until tzf-dist publishes the .tzb artifact release: the
# tzf checkout's build script assembles the artifact set from the upstream
# raw GeoJSON and installs it over tzf-dist's committed placeholders.
#
# POST-RELEASE FORM: every step guarded by `steps.data.outputs.bootstrap`
# below becomes dead once Cargo.toml switches to the release-form
# dependencies (registry `tzf-dist` + git `tzf-dist-git`, see Cargo.toml).
# The guard makes that automatic — the tzf / tzf-dist checkouts, the Go
# toolchain, the artifact cache and the build script all skip themselves,
# and the job reduces to "checkout, setup-rust, make ci". Delete the
# guarded steps, the three env vars and `defaults.run.working-directory`
# (moving the checkout back to the workspace root) in a follow-up cleanup.
# `make test-full` / `make bench-full` keep working after the switch:
# building tzf-rs from its own manifest uses the git source of
# `tzf-dist-git`, which carries full.tzb. Only *consumers of the published
# crate* lose the git source (see Cargo.toml's release-form notes).
TZF_REF: embedded
TZF_DIST_REF: v2-artifacts
TBB_VERSION: 2026d
permissions:
contents: write
deployments: write
concurrency:
group: publish-${{ github.ref_name }}
cancel-in-progress: false
defaults:
run:
working-directory: tzf-rs
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
path: tzf-rs
# True only while Cargo.toml carries the dev-form path dependency on
# ../tzf-dist. Everything below that is guarded on it disappears by
# itself once the release-form dependencies land.
- name: Does this manifest still need the sibling tzf-dist bootstrap?
id: data
run: |
if grep -Eq '^[[:space:]]*tzf-dist[[:space:]]*=.*path[[:space:]]*=' Cargo.toml; then
echo "bootstrap=true" >> "$GITHUB_OUTPUT"
else
echo "bootstrap=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v7
if: steps.data.outputs.bootstrap == 'true'
with:
repository: ringsaturn/tzf
ref: ${{ env.TZF_REF }}
path: tzf
- uses: actions/checkout@v7
if: steps.data.outputs.bootstrap == 'true'
with:
repository: ringsaturn/tzf-dist
ref: ${{ env.TZF_DIST_REF }}
path: tzf-dist
- uses: actions/setup-go@v7
if: steps.data.outputs.bootstrap == 'true'
with:
go-version-file: tzf/go.mod
cache-dependency-path: tzf/go.sum
- name: Cache tzf-dist artifact build
if: steps.data.outputs.bootstrap == 'true'
uses: actions/cache@v6
with:
path: tzf/tmp/tzf-dist-dev
key: tzf-dist-dev-${{ env.TBB_VERSION }}-${{ hashFiles('tzf/scripts/build-tzf-dist-dev.sh', 'tzf/internal/**', 'tzf/cmd/**') }}
- name: Build and install tzf-dist artifacts
if: steps.data.outputs.bootstrap == 'true'
working-directory: tzf
run: ./scripts/build-tzf-dist-dev.sh
- uses: actions-rust-lang/setup-rust-toolchain@v2
with:
components: rustfmt, clippy
cache-workspaces: tzf-rs
- run: make ci
- name: Publish benchmark summary to job summary
if: always()
run: |
if [ -f benchmark_summary.md ]; then
cat benchmark_summary.md >> "$GITHUB_STEP_SUMMARY"
else
echo "benchmark_summary.md not found." >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload benchmark summary artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark_summary
path: |
tzf-rs/benchmark_summary.md
tzf-rs/benchmark_result.txt
tzf-rs/benchmark_full_result.txt
- name: Upload criterion results artifact
uses: actions/upload-artifact@v7
with:
name: criterion_result
path: tzf-rs/target/criterion