Skip to content

Commit

Permalink
Remove bump version option
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Sep 11, 2023
1 parent b54187e commit 59ab9c0
Showing 1 changed file with 18 additions and 28 deletions.
46 changes: 18 additions & 28 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build wheels
run-name: Build wheels (use-server-rc=${{ inputs.use-server-rc }}, should-bump-version=${{ inputs.should-bump-version }}, bump-rc-or-release=${{ inputs.bump-rc-or-release }}, server-tag=${{ inputs.server-tag }}, optimized-or-debug=${{ inputs.optimized-or-debug}})
run-name: Build wheels (use-server-rc=${{ inputs.use-server-rc }}, bump-rc-or-release=${{ inputs.bump-rc-or-release }}, server-tag=${{ inputs.server-tag }}, optimized-or-debug=${{ inputs.optimized-or-debug}})

# Builds wheels and optionally sends artifacts to Jfrog Artifactory
on:
Expand All @@ -25,23 +25,17 @@ on:
- optimized
- debug
default: 'optimized'
should-bump-version:
type: boolean
required: true
default: true
description: 'If building optimized artifacts, bump version and upload to JFrog?'
bump-rc-or-release:
type: choice
options:
- rc
- release
default: 'rc'
required: true
description: 'If bumping version, what type of bump?'
description: 'If building optimized artifacts, what type of version bump?'

jobs:
update-version:
if: ${{ inputs.optimized-or-debug == 'optimized' && inputs.should-bump-version }}
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
Expand All @@ -53,35 +47,35 @@ jobs:
fetch-depth: 0

- run: pip install python-semantic-release==7.34.6
- run: |
latest_tag=$(cat VERSION)
echo "Bumping off of latest tag $latest_tag"
# If creating release wheels, bump rc version to release version
if [[ ${{ inputs.bump-rc-or-release }} == "rc" ]]; then
new_tag=$(pysemver bump prerelease $latest_tag)
else
new_tag=$(pysemver nextver $latest_tag patch)
fi
echo "NEW_TAG=$new_tag" >> $GITHUB_ENV
echo "The new tag for this build is $new_tag"

- name: Bump to next release candidate version
if: ${{ inputs.optimized-or-debug == 'optimized' && inputs.bump-rc-or-release == 'rc' }}
run: echo "NEW_TAG=$(pysemver bump prerelease $(cat VERSION))" >> $GITHUB_ENV

- name: Bump to next release version
if: ${{ inputs.optimized-or-debug == 'optimized' && inputs.bump-rc-or-release == 'release' }}
run: echo "NEW_TAG=$(pysemver nextver $(cat VERSION) patch)" >> $GITHUB_ENV

- name: Label as debug version
if: ${{ inputs.optimized-or-debug == 'debug' }}
run: |
current_commit=$(git rev-parse HEAD)
echo "NEW_TAG=$(cat VERSION)+debug.$current_commit" >> $GITHUB_ENV
- name: Update version
run: |
sed -i "s/const char version\[] = \".*\";/const char version\[] = \"${{ env.NEW_TAG }}\";/" src/main/aerospike.c
echo -e "${{ env.NEW_TAG }}" > VERSION
- name: Commit new version
if: ${{ inputs.optimized-or-debug == 'optimized' }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump version to ${{ env.NEW_TAG }}

build-sdist:
name: Build and install sdist
runs-on: ubuntu-latest
# Need to replace default success() condition because skipped job is not "successful"
# always() will cause this job to become uncancellable, so we check if current job hasn't been cancelled yet
# Run if update version workflow was skipped or succeeds
if: ${{ !cancelled() && (needs.update-version.result == 'skipped' || needs.update-version.result == 'success') }}
needs: update-version
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -147,7 +141,6 @@ jobs:
manylinux_arm64:
runs-on: ubuntu-latest
needs: update-version
if: ${{ !cancelled() && (needs.update-version.result == 'skipped' || needs.update-version.result == 'success') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -215,7 +208,6 @@ jobs:
manylinux_x86_64:
runs-on: ubuntu-latest
needs: update-version
if: ${{ !cancelled() && (needs.update-version.result == 'skipped' || needs.update-version.result == 'success') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -418,7 +410,6 @@ jobs:

macOS-x86:
needs: update-version
if: ${{ !cancelled() && (needs.update-version.result == 'skipped' || needs.update-version.result == 'success') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -467,7 +458,6 @@ jobs:
macOS-m1:
runs-on: [self-hosted, macOS, ARM64]
needs: update-version
if: ${{ !cancelled() && (needs.update-version.result == 'skipped' || needs.update-version.result == 'success') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -531,7 +521,7 @@ jobs:
docker container prune -f
upload-artifacts-to-jfrog:
if: ${{ inputs.should-bump-version }}
if: ${{ inputs.optimized-or-debug == 'optimized' }}
needs: [
# Cat 1 tests
source-installs,
Expand Down

0 comments on commit 59ab9c0

Please sign in to comment.