Unfold support #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only trigger when a pull request into main branch is merged | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
publish: | |
# This job will only run if the PR has been merged (and not closed without merging). | |
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Test package is publishable with PyPI test server | |
uses: JRubics/poetry-publish@v1.16 | |
with: | |
python_version: '3.9' | |
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_name: 'testpypi' | |
repository_url: 'https://test.pypi.org/legacy/' | |
- name: Publish latest package to PyPI | |
uses: JRubics/poetry-publish@v1.16 | |
with: | |
python_version: '3.9' | |
poetry_version: '==1.4.2' # (PIP version specifier syntax) | |
pypi_token: ${{ secrets.PYPI_TOKEN }} | |
ignore_dev_requirements: 'yes' | |
release: | |
# This job will only run if the PR has been merged (and not closed without merging). | |
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')" | |
runs-on: ubuntu-latest | |
needs: [publish] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install poetry | |
run: pip install poetry | |
- name: Get package version | |
id: version | |
run: echo "::set-output name=package_version::$(poetry version -s)" | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own. | |
with: | |
tag_name: ${{ steps.version.outputs.package_version }} | |
release_name: ${{ github.event.pull_request.title }} | |
body: ${{ github.event.pull_request.body }} | |
draft: false | |
prerelease: false |