Skip to content

Commit 15a1737

Browse files
committed
Fix tagging process and run it
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent b158f94 commit 15a1737

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/ci-and-release-tag.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,40 @@ jobs:
6565
run: |
6666
set -euo pipefail
6767
68+
current_tag="$(python3 scripts/version_pair.py tag)"
6869
zero_sha="0000000000000000000000000000000000000000"
6970
if [[ "${BEFORE}" != "${zero_sha}" ]] && ! git cat-file -e "${BEFORE}^{commit}" 2>/dev/null; then
7071
git fetch --no-tags --depth=1 origin "${BEFORE}" || true
7172
fi
7273
7374
if [[ "${BEFORE}" == "${zero_sha}" ]] || ! git cat-file -e "${BEFORE}:Cargo.lock" 2>/dev/null; then
74-
tag="$(python3 scripts/version_pair.py tag)"
75-
echo "initial release tag: ${tag}"
75+
echo "initial release tag: ${current_tag}"
7676
{
7777
echo "release_needed=true"
7878
echo "old_tag="
79-
echo "new_tag=${tag}"
79+
echo "new_tag=${current_tag}"
8080
echo "changes=initial"
8181
} >> "$GITHUB_OUTPUT"
8282
else
8383
git show "${BEFORE}:Cargo.lock" > /tmp/previous-Cargo.lock
84+
version_output="$(mktemp)"
8485
python3 scripts/version_pair.py changed \
8586
--old /tmp/previous-Cargo.lock \
8687
--new Cargo.lock \
87-
--github-output "$GITHUB_OUTPUT"
88+
--github-output "${version_output}"
89+
90+
release_needed="$(awk -F= '$1 == "release_needed" { print $2 }' "${version_output}")"
91+
if [[ "${release_needed}" == "false" ]] && ! git rev-parse -q --verify "refs/tags/${current_tag}" >/dev/null; then
92+
echo "current release tag missing: ${current_tag}"
93+
{
94+
echo "release_needed=true"
95+
echo "old_tag=${current_tag}"
96+
echo "new_tag=${current_tag}"
97+
echo "changes=missing-tag"
98+
} >> "$GITHUB_OUTPUT"
99+
else
100+
cat "${version_output}" >> "$GITHUB_OUTPUT"
101+
fi
88102
fi
89103
90104
- name: Create release tag

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ In the future we hope we can minimize the amount of identical code, but for the
1313

1414
Release tags use the format `<vortex-version>-<df-version>`, where `vortex-version` is the resolved `vortex-datafusion` crate version and `df-version` is the resolved `datafusion`/`datafusion-cli` crate version.
1515

16-
Merges to `main` create a tag only when `Cargo.lock` changes either of those resolved versions. Code, docs, or unrelated dependency changes still run CI, but do not create release tags.
16+
Pushes to `main` create the current tag if it does not already exist. Later merges to `main` create a new tag only when `Cargo.lock` changes either of those resolved versions. Code, docs, or unrelated dependency changes still run CI, but do not create release tags once the current tag exists.
1717

1818
[Renovate](https://docs.renovatebot.com/) updates Cargo manifests, `Cargo.lock`, and GitHub Actions workflow action versions. DataFusion and DataFusion CLI updates are grouped together so they continue to resolve to the same version.

0 commit comments

Comments
 (0)