Skip to content

Commit

Permalink
fix: Fix semantic-release scripts (#24)
Browse files Browse the repository at this point in the history
This PR adjusts the `semantic-release` scripts to ensure that the
version number is patched before the Python builds and tests occur.
  • Loading branch information
ajschmidt8 authored Nov 23, 2022
1 parent 0ec3564 commit fc8d01d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
24 changes: 0 additions & 24 deletions .github/actions/build-test/action.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "Setup Python"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
4 changes: 3 additions & 1 deletion .github/workflows/prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/build-test
- uses: ./.github/actions/setup-python
- name: Build & Test
run: ./ci/build-test.sh
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/build-test
- uses: ./.github/actions/setup-python
- name: Setup Node.js
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ plugins:
- "@semantic-release/release-notes-generator"
- "@semantic-release/github"
- - "@semantic-release/exec"
- prepareCmd: ./ci/update-version.sh ${nextRelease.version}
- verifyReleaseCmd: ./ci/update-version.sh ${nextRelease.version} && ./ci/build-test.sh
publishCmd: ./ci/pypi-publish.sh
15 changes: 15 additions & 0 deletions ci/build-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Builds and tests Python package
set -ue

pip install build pytest

python -m build .

for PKG in dist/*; do
echo "$PKG"
pip uninstall -y rapids-dependency-file-generator
pip install "$PKG"
pytest
rapids-dependency-file-generator -h # test CLI output
done
2 changes: 1 addition & 1 deletion ci/pypi-publish.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Simple script to upload packages to PyPI
# Uploads packages to PyPI
set -ue

twine upload \
Expand Down
2 changes: 1 addition & 1 deletion ci/update-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Simple script to update the version string in `_version.py`
# Updates the version string in `_version.py`
set -ue

NEXT_VERSION=$1
Expand Down

0 comments on commit fc8d01d

Please sign in to comment.