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

Adds workflow for publishing the next version of the package to PyPi #36

Merged
merged 2 commits into from
Apr 15, 2024
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
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
name: Build Documentation
name: Build and Publish Documentation

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-tags: true

- name: Set up Python 3.11
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/package_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release the Next Version of the Package

on:
release:
types: [published]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/documentation.yml
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build
python3 -m pip install twine
- name: Build package
run: python -m build
- name: Check package
run: python3 -m twine check dist/*
- name: Publish package to Test-PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Pull request

on:
push:
Expand All @@ -18,12 +18,12 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install testing environment and kegg_pull package
- name: Install testing environment and gpu-tracker package
run: bash tests/install.sh
- name: Test with pytest
run: bash tests/run.sh