Skip to content

RELEASE

RELEASE #22

name: Release PR PyPi
on:
pull_request:
types: [ closed ]
env:
ARTIFACT_BASE_NAME: mdps-ds-lib
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
GH_TOKEN: ${{ github.token }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
jobs:
if_merged:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && (contains(github.event.pull_request.title, 'update version + change log'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- run: |
python3 -m pip install poetry twine
- run: |
python3 -m poetry build
- run: |
python3 -m twine upload --repository pypi dist/*
- run: |
# make file runnable, might not be necessary
chmod +x "${GITHUB_WORKSPACE}/.ci/store_version.sh"
"${GITHUB_WORKSPACE}/.ci/store_version.sh"
- name: Create Release
id: create_release
if: ${{ contains(github.ref, 'master') }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: "v${{ env.software_version }}"
release_name: "Release v${{ env.software_version }} - ${{ github.ref }}"
body: |
Changes in this release:
${{ github.event.head_commit.message }}
body_path: release.md
draft: false
prerelease: false