Minor fixes #10
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
name: cd | |
# 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' | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Poetry | |
uses: snok/[email protected] | |
- name: Build a binary wheel and a source tarball | |
run: poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/[email protected] | |
with: | |
verbose: true | |
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 |