Commit 7c058f2
committed
Stable per-branch SNAPSHOTs on CI (git-versioning)
me.qoomon.git-versioning v6.4.4 intermittently fails to detect the
branch on GitHub Actions runners and falls back to the rev clause,
producing the static gradle.properties version (2.0.0-rc5) instead of
<branch-slug>-SNAPSHOT. The failure is per-workflow-run, not per-
branch — same SHA, different runs, different results.
Root cause: actions/checkout leaves HEAD detached and only creates
refs/remotes/origin/<branch>; the plugin's heuristic sometimes picks
up the branch via the remote ref and sometimes doesn't.
Fix: after each checkout, materialise refs/heads/<branch> with
`git update-ref` pointing at HEAD. Deterministic, idempotent, and lets
git-versioning find the branch the same way it does locally.
Applied to all three workflows that invoke gradle (build-artifacts,
gradle-build's publish-gh-packages job, gh-pages). Also adds the
missing `fetch-depth: 0` to gh-pages.yml so the branch ref is actually
present.
Stable per-branch SNAPSHOTs are needed because integration tests
publish to and consume from build/maven-repo under the derived
coordinate; if it drifts to 2.0.0-rc5 we collide with the upcoming
release version and can't reliably exercise the branch's actual code.1 parent 874be23 commit 7c058f2
3 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
34 | 54 | | |
35 | 55 | | |
36 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
54 | 76 | | |
55 | 77 | | |
56 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
| |||
0 commit comments