Merge pull request #715 from launchableinc/scenario-hook #278
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
# This workflows will upload a Python Package | |
# For more information see: https://github.com/marketplace/actions/pypi-publish | |
name: Upload Python Package | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
tagpr: | |
permissions: | |
actions: write | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.run-tagpr.outputs.tag }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- id: run-tagpr | |
uses: Songmu/tagpr@d240cfd0ec8d697b1f19b4b67b0b52c151214f45 # v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: tagpr | |
if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
# build and publish package using GitHub Actions workflow | |
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
- 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/ | |
. | |
# actual publish | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Actions for Discord | |
uses: Ilshidur/[email protected] | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
with: | |
args: 'Launchable CLI ${{ needs.tagpr.outputs.tag }} is released! https://github.com/launchableinc/cli/releases/tag/${{ needs.tagpr.outputs.tag }}' |