Skip to content

Commit

Permalink
ci: fix type in release commit job (#2283)
Browse files Browse the repository at this point in the history
Co-authored-by: Lance Release <[email protected]>
  • Loading branch information
wjones127 and Lance Release authored May 2, 2024
1 parent 9ddcadd commit d661932
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 38 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/make-release-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ on:
dry_run:
description: 'Dry run (create the local commit/tags but do not push it)'
required: true
default: "false"
type: choice
options:
- "true"
- "false"
default: false
type: boolean
type:
description: 'What kind of release is this?'
required: true
Expand All @@ -20,18 +17,17 @@ on:
- preview
- stable
draft-release:
description: 'When creating release, should it be a draft?'
description: 'Create a draft release on GitHub'
required: true
default: "false"
type: choice
options:
- "true"
- "false"
default: false
type: boolean

jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"
- name: Check out main
uses: actions/checkout@v4
with:
Expand All @@ -55,7 +51,7 @@ jobs:
if [ "$RELEASE_TYPE" == "stable" ]; then
echo "Creating stable release for version $CURRENT_VERSION"
TAG = "v${CURRENT_VERSION}"
TAG="v${CURRENT_VERSION}"
else
# Get a list of all tags, filter for current version beta tags, sort them and get the last one
LAST_BETA_TAG=$(git tag | grep "^v${CURRENT_VERSION}-beta." | sort -V | tail -n 1)
Expand All @@ -71,41 +67,41 @@ jobs:
fi
echo "Creating beta release for version $CURRENT_VERSION: $NEXT_BETA_TAG"
TAG = $NEXT_BETA_TAG
TAG=$NEXT_BETA_TAG
fi
git tag $TAG
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Push new version tag
if: ${{ inputs.dry_run }} == "false"
if: ${{ !inputs.dry_run }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.LANCE_RELEASE_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Create GH release
if: ${{ inputs.dry_run }} == "false"
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ inputs.type }} == "preview"
draft: ${{ inputs.draft-release }} == "true"
target_commitish: ${{ steps.create_tag.outputs.tag }}
prerelease: ${{ inputs.type == 'preview' }}
draft: ${{ inputs.draft-release }}
tag_name: ${{ steps.create_tag.outputs.tag }}
token: ${{ secrets.LANCE_RELEASE_TOKEN }}
generate_release_notes: true

# Remaining steps only apply to stable releases
- name: Call bumpversion
uses: ./.github/workflows/bump-version
if: ${{ inputs.type }} == "stable"
if: inputs.type == 'stable'
with:
part: patch
- name: Commit bump version
if: ${{ inputs.type }} == "stable"
if: inputs.type == 'stable'
run: |
git add -u
git commit -m "Bump version"
- name: Push new version
if: ${{ inputs.type }} == "stable" && ${{ inputs.dry_run }} == "false"
if: ${{ inputs.type == 'stable' && !inputs.dry_run }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.LANCE_RELEASE_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -86,6 +87,7 @@ jobs:
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
Expand Down Expand Up @@ -118,11 +120,13 @@ jobs:
python-version: 3.${{ matrix.python-minor-version }}
- name: Handle tag
id: handle_tag
shell: bash
run: |
# If the tag ends with -beta.N, we need to call setup_version.py
# and export repo as "fury" instead of "pypi"
if [[ ${{ github.ref }} == refs/tags/*-beta.* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
pip install packaging
python ci/setup_version.py $TAG
echo "repo=fury" >> $GITHUB_OUTPUT
else
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/upload_wheel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ runs:
- name: Publish to PyPI
working-directory: python
shell: bash
env:
FURY_TOKEN: ${{ inputs.fury_token }}
PYPI_TOKEN: ${{ inputs.pypi_token }}
run: |
if [ ${{ inputs.repo }} == "fury" ]; then
WHEEL=$(ls target_pyo3/wheels/pylance-*.whl 2> /dev/null | head -n 1)
curl -F package=@WHEEL https://${{ inputs.fury_token }}@push.fury.io/lancedb/
curl -F package=@WHEEL https://$FURY_TOKEN@push.fury.io/lancedb/
else
twine upload --repository ${{ inputs.repo }} \
--username __token__ \
--password ${{ inputs.pypi_token }} \
--password $PYPI_TOKEN \
target/wheels/pylance-*.whl
fi
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exclude = ["python"]
resolver = "2"

[workspace.package]
version = "0.10.17"
version = "0.10.18"
edition = "2021"
authors = ["Lance Devs <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -42,19 +42,19 @@ categories = [
rust-version = "1.75"

[workspace.dependencies]
lance = { version = "=0.10.17", path = "./rust/lance" }
lance-arrow = { version = "=0.10.17", path = "./rust/lance-arrow" }
lance-core = { version = "=0.10.17", path = "./rust/lance-core" }
lance-datafusion = { version = "=0.10.17", path = "./rust/lance-datafusion" }
lance-datagen = { version = "=0.10.17", path = "./rust/lance-datagen" }
lance-encoding = { version = "=0.10.17", path = "./rust/lance-encoding" }
lance-file = { version = "=0.10.17", path = "./rust/lance-file" }
lance-index = { version = "=0.10.17", path = "./rust/lance-index" }
lance-io = { version = "=0.10.17", path = "./rust/lance-io" }
lance-linalg = { version = "=0.10.17", path = "./rust/lance-linalg" }
lance-table = { version = "=0.10.17", path = "./rust/lance-table" }
lance-test-macros = { version = "=0.10.17", path = "./rust/lance-test-macros" }
lance-testing = { version = "=0.10.17", path = "./rust/lance-testing" }
lance = { version = "=0.10.18", path = "./rust/lance" }
lance-arrow = { version = "=0.10.18", path = "./rust/lance-arrow" }
lance-core = { version = "=0.10.18", path = "./rust/lance-core" }
lance-datafusion = { version = "=0.10.18", path = "./rust/lance-datafusion" }
lance-datagen = { version = "=0.10.18", path = "./rust/lance-datagen" }
lance-encoding = { version = "=0.10.18", path = "./rust/lance-encoding" }
lance-file = { version = "=0.10.18", path = "./rust/lance-file" }
lance-index = { version = "=0.10.18", path = "./rust/lance-index" }
lance-io = { version = "=0.10.18", path = "./rust/lance-io" }
lance-linalg = { version = "=0.10.18", path = "./rust/lance-linalg" }
lance-table = { version = "=0.10.18", path = "./rust/lance-table" }
lance-test-macros = { version = "=0.10.18", path = "./rust/lance-test-macros" }
lance-testing = { version = "=0.10.18", path = "./rust/lance-testing" }
approx = "0.5.1"
# Note that this one does not include pyarrow
arrow = { version = "51.0.0", optional = false, features = ["prettyprint"] }
Expand Down
3 changes: 2 additions & 1 deletion ci/setup_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def main():
for i, line in enumerate(lines):
if line.startswith("version = "):
current_version = line.split('"')[1]
lines[i] = f'version = "{args.version}"\n'
# Remove the v prefix
lines[i] = f'version = "{args.version[1:]}"\n'
break
else:
raise ValueError("Could not find version in Cargo.toml")
Expand Down

0 comments on commit d661932

Please sign in to comment.