-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #474 from shangyian/release-management
Align dependency management + workflows for publishing and releasing
- Loading branch information
Showing
24 changed files
with
4,394 additions
and
2,188 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,85 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
library: | ||
type: choice | ||
description: Which library to bump | ||
required: true | ||
options: | ||
- server | ||
- client | ||
bump: | ||
type: choice | ||
description: Hatch version bump rule | ||
required: true | ||
options: | ||
- release | ||
- major | ||
- minor | ||
- patch | ||
- alpha | ||
- beta | ||
- rc | ||
- post | ||
- dev | ||
|
||
jobs: | ||
publish: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
runs-on: 'ubuntu-latest' | ||
defaults: | ||
run: | ||
working-directory: ${{ github.event.inputs.library == 'server' && '.' || './client/python' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
- uses: pdm-project/setup-pdm@v3 | ||
name: Setup PDM | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
prerelease: true | ||
enable-pep582: true | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
- name: Bump release version with poetry and tag | ||
run: | | ||
hatch version ${{ github.event.inputs.bump }} | ||
export NEW_VERSION=v$(hatch version) | ||
export LIBRARY=${{ github.event.inputs.library }} | ||
git commit -am "Bumping $LIBRARY to version $NEW_VERSION" | ||
git tag -a $NEW_VERSION -m $NEW_VERSION | ||
git push origin $NEW_VERSION | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
|
||
- name: Publish to pypi | ||
env: | ||
HATCH_INDEX_USER: __token__ | ||
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
hatch build | ||
hatch publish | ||
- name: Create Github release | ||
run: | | ||
gh release create $(hatch version) --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} |
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,45 @@ | ||
name: Run tests for DJ | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
|
||
defaults: | ||
run: | ||
working-directory: './client/python' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: pdm-project/setup-pdm@v3 | ||
name: Setup PDM | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
prerelease: true | ||
enable-pep582: true | ||
- name: Install dependencies | ||
run: pdm install | ||
- name: Linters | ||
run: | | ||
pdm run pre-commit run --all-files | ||
- name: Test DJ ${{ matrix.library }} with pytest | ||
run: | | ||
export module=${{ matrix.library == 'server' && 'dj' || 'datajunction' }} | ||
pdm run pytest --cov-fail-under=100 --cov=$module -vv tests/ --doctest-modules $module --without-integration --without-slow-integration |
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,46 @@ | ||
name: Run tests for DJ | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
library: ['client', 'server'] | ||
|
||
defaults: | ||
run: | ||
working-directory: ${{ matrix.library == 'server' && '.' || './client/python' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: pdm-project/setup-pdm@v3 | ||
name: Setup PDM | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
prerelease: true | ||
enable-pep582: true | ||
- name: Install dependencies | ||
run: pdm install | ||
- name: Linters | ||
run: | | ||
pdm run pre-commit run --all-files | ||
- name: Test DJ ${{ matrix.library }} with pytest | ||
run: | | ||
export module=${{ matrix.library == 'server' && 'dj' || 'datajunction' }} | ||
pdm run pytest --cov-fail-under=100 --cov=$module -vv tests/ --doctest-modules $module --without-integration --without-slow-integration |
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 |
---|---|---|
|
@@ -114,3 +114,4 @@ ENV/ | |
|
||
# MacOS | ||
.DS_Store | ||
.pdm-python |
File renamed without changes.
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 |
---|---|---|
|
@@ -52,3 +52,4 @@ MANIFEST | |
.venv*/ | ||
.conda*/ | ||
.python-version | ||
.pdm-python |
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,2 @@ | ||
* | ||
!.gitignore |
Oops, something went wrong.