Repository navigation
Commit 200117b
authored
Publish the version the build job computed (#631)
Each job in the `Publish` workflow checks out again and recomputes the
version from git. If a tag is added after the `build` job has run, a
later job publishes a different version from the one `build` computed.
Two ways this happens:
- `createRelease --push` on a release branch tags the commit while its
run is in progress;
- someone reruns a failed publish job after tagging.
Example: a push to `release/v1.3` builds `1.3.1-rc2`, so `build` reports
a prerelease and `publish-maven-central` is skipped. The commit is then
tagged `1.3.1`. A rerun of `publish-github-packages` sees the tag and
publishes **`1.3.1`** to GitHub Packages, while Maven Central never gets
it.
## Changes
- `GitVersion.version()` returns `DBOS_VERSION_OVERRIDE` when it is set,
and otherwise derives the version from git as before.
- `publish-github-packages` and `publish-maven-central` set
`DBOS_VERSION_OVERRIDE` from `needs.build.outputs.version`. They no
longer compute the version, so they check out at the default depth
instead of the full history. `build` still uses the full history.
I checked this in a depth-1 clone: with `DBOS_VERSION_OVERRIDE=1.3.1`,
the build produces `transact-1.3.1.jar` with `Implementation-Version:
1.3.1` and the correct `SCM-Revision`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent d4bd0e5 commit 200117b
2 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
80 | | - | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
103 | | - | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
0 commit comments