-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5e319e
commit 6f75a1a
Showing
25 changed files
with
556 additions
and
117 deletions.
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
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,68 @@ | ||
name: 'Project Release (Test)' | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-build-publish-package: | ||
name: Test, Build, & Publish Python Package | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Set up the environment to run Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
# Set up the environment to run the latest Python build, test, and publish tools | ||
- name: Set Up Environment | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install --upgrade setuptools | ||
python3 -m pip install --upgrade wheel | ||
python3 -m pip install --upgrade pytest | ||
python3 -m pip install --upgrade twine | ||
# Install the package from source | ||
- name: Install Source Code | ||
run: | | ||
python3 -m pip install . | ||
# Run the package tests | ||
- name: Test Source Code | ||
run: | | ||
python3 -m pytest -v | ||
# Build the package | ||
- name: Build Package | ||
run: | | ||
python3 -m pip install --upgrade build | ||
python3 -m build | ||
# Check the distribution files with Twine | ||
- name: Check Package | ||
run: | | ||
python3 -m twine check dist/* | ||
# Store the distribution files as artifacts | ||
- name: Upload Package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package | ||
path: dist/ | ||
|
||
# Upload the distribution artifacts to PyPi test environment for all (supported) scenarios | ||
- name: Publish Package (PyPi Test) | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist/ | ||
password: ${{ secrets.PYPI_TEST_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ |
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,94 @@ | ||
name: 'Project Release' | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-build-publish-package: | ||
name: Test, Build, & Publish Python Package | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Set up the environment to run Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
# Set up the environment to run the latest Python build, test, and publish tools | ||
- name: Set Up Environment | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install --upgrade setuptools | ||
python3 -m pip install --upgrade wheel | ||
python3 -m pip install --upgrade pytest | ||
python3 -m pip install --upgrade twine | ||
# Install the package from source | ||
- name: Install Source Code | ||
run: | | ||
python3 -m pip install . | ||
# Run the package tests | ||
- name: Test Source Code | ||
run: | | ||
python3 -m pytest -v | ||
# Build the package | ||
- name: Build Package | ||
run: | | ||
python3 -m pip install --upgrade build | ||
python3 -m build | ||
# Check the distribution files with Twine | ||
- name: Check Package | ||
run: | | ||
python3 -m twine check dist/* | ||
# Store the distribution files as artifacts | ||
- name: Upload Package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package | ||
path: dist/ | ||
|
||
# Upload the distribution artifacts to PyPi production environment | ||
- name: Publish Package (PyPi) | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: dist/ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
# Sign the distribution files with Sigstore | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
# Create a GitHub Release | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: >- | ||
gh release create -d | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
# Upload the distribution artifact signatures to the GitHub Release | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' |
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: 'Python Build' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'dev' | ||
- 'main' | ||
- 'dependabot/**' | ||
- 'feature/**' | ||
- 'issue/**' | ||
- 'release/**' | ||
tags: | ||
- 'v*.*.*' | ||
paths: | ||
- src/** | ||
- tests/** | ||
- setup.py | ||
pull_request: | ||
branches: | ||
- 'dev' | ||
- 'main' | ||
- 'dependabot/**' | ||
- 'feature/**' | ||
- 'issue/**' | ||
- 'release/**' | ||
tags: | ||
- 'v*.*.*' | ||
paths: | ||
- src/** | ||
- tests/** | ||
- setup.py | ||
|
||
jobs: | ||
test-build-package: | ||
name: Test & Build Python Package | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
# Set up the environment to run Python | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
|
||
# Set up the environment to run the latest Python build, test, and publish tools | ||
- name: Set Up Environment | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install --upgrade setuptools | ||
python3 -m pip install --upgrade wheel | ||
python3 -m pip install --upgrade pytest | ||
python3 -m pip install --upgrade twine | ||
# Install the package from source | ||
- name: Install Source Code | ||
run: | | ||
python3 -m pip install . | ||
# Run the package tests | ||
- name: Test Source Code | ||
run: | | ||
python3 -m pytest -v | ||
# Build the package | ||
- name: Build Package | ||
run: | | ||
python3 -m pip install --upgrade build | ||
python3 -m build | ||
# Check the distribution files with Twine | ||
- name: Check Package | ||
run: | | ||
python3 -m twine check dist/* | ||
# Store the distribution files as artifacts | ||
- name: Upload Package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package | ||
path: dist/ |
Oops, something went wrong.