-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add release GitHub actions #336
Open
klwetstone
wants to merge
10
commits into
master
Choose a base branch
from
317-ci-github
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
246f71a
add __version__
klwetstone 4cc764e
add ccds.__version__
klwetstone 8f9617a
add make dist
klwetstone 91bf84b
add release.yml
klwetstone 492a0a1
update python version
klwetstone 1dbf799
add publish to pypi
klwetstone cf2d4b8
use currently released version by default
chrisjkuch c79d820
Update README and docs
chrisjkuch 2ea3c9a
find the index of the checkout branch parameter in cookiecutter by us…
chrisjkuch 7b49256
update readme with accurate version info
chrisjkuch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
name: Build and publish new release | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r dev-requirements.txt | ||
|
||
- name: Check that versions match | ||
id: version | ||
run: | | ||
echo "Release tag: [${{ github.event.release.tag_name }}]" | ||
PACKAGE_VERSION=$(python -c "import ccds; print(ccds.__version__)") | ||
echo "Package version: [$PACKAGE_VERSION]" | ||
[ ${{ github.event.release.tag_name }} == "v$PACKAGE_VERSION" ] || { exit 1; } | ||
echo "::set-output name=major_minor_version::v${PACKAGE_VERSION%.*}" | ||
|
||
- name: Build package | ||
run: | | ||
make dist | ||
|
||
- name: Publish to Test PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: ${{ secrets.PYPI_TEST_USERNAME }} | ||
password: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
- name: Publish to Production PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: ${{ secrets.PYPI_PROD_USERNAME }} | ||
password: ${{ secrets.PYPI_PROD_PASSWORD }} | ||
skip_existing: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from ccds.version import __version__ | ||
|
||
__version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import sys | ||
|
||
if sys.version_info[:2] >= (3, 8): | ||
import importlib.metadata as importlib_metadata | ||
else: | ||
import importlib_metadata | ||
|
||
|
||
__version__ = importlib_metadata.version("cookiecutter-data-science") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It looks like some places (like the release tags), we use
vX.Y.Z
and others we useX.Y.Z
. We should check if we need thev
prefix here or not.