Skip to content

Publish Release

Publish Release #41

Workflow file for this run

name: Publish Release
on:
workflow_run:
workflows: [ "Run Test Cases" ]
branches: [ main ]
types:
- completed
jobs:
build:
# The type of runner that the job will run on
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: Set up Python
uses: actions/setup-python@v2
- name: Get Version
id: get_version
run: echo "##[set-output name=version;]$(source ./.env && export VERSION && echo $VERSION)"
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
env:
VERSION: ${{ steps.get_version.outputs.version }}
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
VERSION: ${{ steps.get_version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_version.outputs.version }}
release_name: PyOpenProject ${{ steps.get_version.outputs.version }}
body_path: CHANGELOG.md
draft: false
prerelease: false
- name: Delete tag
run: |
echo "${{ steps.get_version.outputs.version }}"
git push --delete origin "${{ steps.get_version.outputs.version }}"
if: ${{ failure() }}