Skip to content

Commit 1e45609

Browse files
committed
Base doc-commit off master branch, not disjoint releases one
1 parent 35ca7d7 commit 1e45609

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

.github/workflows/release-version.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,35 +164,40 @@ jobs:
164164
- name: "Install Rust (uncached)"
165165
run: rustup update stable
166166

167-
- name: "Commit raw changes"
168-
run: |
169-
# Backup current repo, so we can checkout.
170-
mkdir -p /tmp/repo
171-
rsync -av --exclude .git --exclude target ./ /tmp/repo/
172-
git fetch origin releases && git switch releases || git switch --orphan releases
173-
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
174-
# Restore.
175-
rsync -av --ignore-existing /tmp/repo/ .
176-
177-
# Commit.
178-
git config user.name "Godot-Rust Automation"
179-
git config user.email "[email protected]"
180-
git add .
181-
git commit -m "Repo state for v${{ env.GDEXT_PUBLISHED_VERSION }}"
167+
- name: "Tag base commit"
168+
run: git tag "v$GDEXT_PUBLISHED_VERSION"
169+
170+
# - name: "Commit raw changes"
171+
# # Note: first block was for an alternative approach, where a separate `releases` branch tracks deployments.
172+
# # Such a branch would however be disjoint and require quite a bit of extra space in the repo.
173+
# run: |
174+
# # Backup current repo, so we can checkout.
175+
# mkdir -p /tmp/repo
176+
# rsync -av --exclude .git --exclude target ./ /tmp/repo/
177+
# git fetch origin releases && git switch releases || git switch --orphan releases
178+
# find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
179+
# # Restore.
180+
# rsync -av --ignore-existing /tmp/repo/ .
181+
#
182+
# git add .
183+
# git commit -m "Repo state for v${{ env.GDEXT_PUBLISHED_VERSION }}"
182184

183185
- name: "Apply #[doc(cfg(...))]"
184186
# Skip --rustfmt, as it causes weird reformatting of quote! {} statements.
185187
# #[doc(cfg(...))] on the same line is the lesser evil.
186188
run: .github/other/apply-doc-cfg.sh --install-sd
187189

188-
- name: "Commit post-processed changes"
189-
run: git commit -am "Postprocess docs for v${{ env.GDEXT_PUBLISHED_VERSION }}"
190+
- name: "Commit post-processed docs"
191+
run: |
192+
git config user.name "Godot-Rust Automation"
193+
git config user.email "[email protected]"
194+
git switch -c tmp
195+
git commit -am "v${{ env.GDEXT_PUBLISHED_VERSION }} (with doc attributes)"
190196
191-
- name: "Push changes + tag version"
197+
- name: "Tag processed commit + push"
192198
run: |
193-
versionTag="v$GDEXT_PUBLISHED_VERSION"
194-
git tag "$versionTag"
195-
git push origin releases "$versionTag"
199+
git tag "docs-v$GDEXT_PUBLISHED_VERSION"
200+
git push origin "v$GDEXT_PUBLISHED_VERSION" "docs-v$GDEXT_PUBLISHED_VERSION"
196201
197202
publish:
198203
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)