Skip to content

Commit

Permalink
chore: test gha
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonSzyszkowski committed Dec 17, 2024
1 parent d7928a2 commit 4237832
Showing 1 changed file with 77 additions and 74 deletions.
151 changes: 77 additions & 74 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,88 +55,91 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.semrelease.outputs.tag }}

- name: Debug
run: echo "Released ${{ steps.semrelease.outputs.released }}"

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
needs: release
name: >-
Publish 📦 in PyPI
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/gentropy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# publish-to-pypi:
# needs: release
# name: >-
# Publish 📦 in PyPI
# if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/gentropy
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish 📦 in TestPyPI
needs: release
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
# publish-to-testpypi:
# name: Publish 📦 in TestPyPI
# needs: release
# if: github.ref != 'refs/heads/main'
# runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/gentropy
# environment:
# name: testpypi
# url: https://test.pypi.org/p/gentropy

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/

documentation:
needs: release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: |
venv-${{ runner.os }}-\
${{ env.PYTHON_VERSION_DEFAULT }}-\
${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --without tests --no-interaction
- name: Publish docs
run: poetry run mkdocs gh-deploy --force
# documentation:
# needs: release
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
# - name: Install and configure Poetry
# uses: snok/install-poetry@v1
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true
# installer-parallel: true
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v4
# with:
# path: .venv
# key: |
# venv-${{ runner.os }}-\
# ${{ env.PYTHON_VERSION_DEFAULT }}-\
# ${{ hashFiles('**/poetry.lock') }}
# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --no-interaction --no-root
# - name: Install library
# run: poetry install --without tests --no-interaction
# - name: Publish docs
# run: poetry run mkdocs gh-deploy --force

0 comments on commit 4237832

Please sign in to comment.