Skip to content

Commit

Permalink
Add publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianolorenti committed Aug 18, 2022
1 parent 20dd173 commit 4e403a9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# This is a basic workflow to help you get started with Actions


name: Documentation

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:

doc:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it

- uses: actions/checkout@v2
- name: Install dependencies
run: |
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@


name: Publish
on:
workflow_run:
workflows: ["Test"]
types:
- completed


jobs:

doc:
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- name: Set up Python ${ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 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 distribution 📦 to PyPI
# if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test

on:
push:
branches: [ main ]
branches: [ main, devel ]
pull_request:
branches: [ main ]
branches: [ main, devel]

jobs:
test:
Expand Down

0 comments on commit 4e403a9

Please sign in to comment.