-
Notifications
You must be signed in to change notification settings - Fork 261
Deploy: take one tag when HEAD has several, and quote the versions #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
262277e
ac60fe2
59f63f3
ca0fdd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,20 +131,36 @@ jobs: | |
| run: | | ||
| pwd | ||
| python3 -m pip install awscli | ||
| # A release and its variants can sit on one commit, and version sort | ||
| # ranks anything suffixed above the release it belongs to, so v1.2.3-rc1 | ||
| # would be picked over v1.2.3. A plain release tag is therefore matched | ||
| # first, because enumerating the suffixes cannot be complete: this | ||
| # registry carries `v0.2.3` beside `v0.2.3-cpp` today, and -cpp is not a | ||
| # pre-release anybody would have thought to name. The suffix list still | ||
| # decides between variants when the commit carries no plain tag at all. | ||
| # awk and not grep: grep exits 1 when nothing matches, and under this | ||
| # step's `-e -o pipefail` that status would abort the deploy for every | ||
| # commit whose tags are not plain releases. It survives today only | ||
| # because the line begins with `export`, which swallows the status. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, you're configuring the ordering of -rc, -beta, and -alpha, however the awk filter on line 154 strips out anything with a suffix before sorting. Therefore either the three git config calls should be deleted, or the awk filter changed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though I see that the fallback does go through the sorted list of tags, so it actually shouldn't be an issue, but could you confirm the intention? Thanks! |
||
| git config --global --add versionsort.suffix -rc | ||
| git config --global --add versionsort.suffix -beta | ||
| git config --global --add versionsort.suffix -alpha | ||
| if [ -n "${{ inputs.duckdb_tag }}" ]; then | ||
| export DUCKDB_VERSION="${{ inputs.duckdb_tag }}" | ||
| else | ||
| git config --global --add safe.directory '*' | ||
| cd duckdb | ||
| git fetch --tags | ||
| export DUCKDB_VERSION=`git tag --points-at HEAD` | ||
| export DUCKDB_VERSION=${DUCKDB_VERSION:=`git log -1 --format=%h`} | ||
| export DUCKDB_VERSION="$(git tag --points-at HEAD --sort=-v:refname | awk '/^v?[0-9]+([.][0-9]+)*$/' | head -n 1)" | ||
| export DUCKDB_VERSION="${DUCKDB_VERSION:-$(git tag --points-at HEAD --sort=-v:refname | head -n 1)}" | ||
| export DUCKDB_VERSION="${DUCKDB_VERSION:-$(git log -1 --format=%h)}" | ||
| cd .. | ||
| fi | ||
| git fetch --tags --no-recurse-submodules | ||
| export EXT_VERSION=`git tag --points-at HEAD` | ||
| export EXT_VERSION=${EXT_VERSION:=`git log -1 --format=%h`} | ||
| ${{ inputs.deploy_script }} ${{ inputs.extension_name }} $EXT_VERSION $DUCKDB_VERSION ${{ matrix.duckdb_arch }} $BUCKET_NAME ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}} | ||
| export EXT_VERSION="$(git tag --points-at HEAD --sort=-v:refname | awk '/^v?[0-9]+([.][0-9]+)*$/' | head -n 1)" | ||
| export EXT_VERSION="${EXT_VERSION:-$(git tag --points-at HEAD --sort=-v:refname | head -n 1)}" | ||
| export EXT_VERSION="${EXT_VERSION:-$(git log -1 --format=%h)}" | ||
| ${{ inputs.deploy_script }} ${{ inputs.extension_name }} "$EXT_VERSION" "$DUCKDB_VERSION" ${{ matrix.duckdb_arch }} "$BUCKET_NAME" ${{inputs.deploy_latest || 'true' && 'false'}} ${{inputs.deploy_versioned || 'true' && 'false'}} | ||
|
|
||
| clean_cache: | ||
| needs: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the big comment, but for code cleanliness its nice to have a more concise explanation of what is being done