Skip to content
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 Pipeline #12

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build & Publish Package

on:
push:
tags:
- '*'
release:
types:
- published

concurrency:
group: ${{ github.event_name }}_${{ github.ref_name }}

jobs:
# Build and verify wheels
build:
name: Build & Verify Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Create Wheel
run: |
pip install wheel
pip wheel . --no-deps --wheel-dir dist
ls -lat dist
- name: Check Wheel
shell: bash
run: |
pip install check-wheel-contents
check-wheel-contents dist/*.whl
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Wheels_${{ github.ref_name }}
path: dist

# Upload to Test PyPI on every tag
release-test-pypi:
needs: build
name: Publish PyPI TEST
environment: release-test-pypi
if: github.repository_owner == 'emdgroup' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Download packages built
uses: actions/download-artifact@v3
with:
name: Wheels_${{ github.ref_name }}
path: dist
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_TOKEN }}

# Upload to real PyPI on GitHub Releases.
release-pypi:
needs: build
name: Publish PyPI PROD
environment: release-pypi
if: github.repository_owner == 'emdgroup' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: '3.11'
- name: Install test-package
run: |
pip install --index-url https://test.pypi.org/simple/ baybe
- name: Download packages built
uses: actions/download-artifact@v3
with:
name: Wheels_${{ github.ref_name }}
path: dist
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Enabled passing optional arguments to `tox -e docs` calls
- Logo and banner images
- Project metadata to pyproject.toml
- PyPI release pipeline

### Changed
- Reworked README for GitHub landing page
- Now has concise contribution guidelines
- Use Furo theme for documentation


### Removed
- `--debug` flag for documentation building

Expand Down