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

GitHub Action - Release #33

Merged
merged 2 commits into from
May 5, 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
9 changes: 8 additions & 1 deletion .github/workflows/push-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7"]
poetry-version: ["1.2.0"]
poetry-version: ["1.2.1"]

steps:
# ======
Expand All @@ -23,7 +23,14 @@ jobs:
# ======
# Install and configure poetry
# ======
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-${{ matrix.poetry-version }}
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
release:
types:
- published

jobs:
release:
name: Deploy release to Test-PyPI
runs-on: ubuntu-latest
environment:
# name: testpypi
name: release
strategy:
matrix:
python-version: ["3.7"]
poetry-version: ["1.2.1"]
steps:
# ======
# Checkout, set up python
# ======
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# ======
# Install poetry
# ======
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: true
# ======
# Install dependencies
# ======
- name: Install dependencies
run: poetry install --no-interaction --no-root
# ======
# Build and upload package to Test-PyPI
# Null API token? "There is no pypi-token.testpypi setting."
# Test?
# poetry config repositories.testpypi https://test.pypi.org/legacy/
# poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
# poetry publish --no-interaction --build -r testpypi
# =====
- name: Upload package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --no-interaction --build