Skip to content

Merge pull request #856 from launchableinc/check-order #359

Merge pull request #856 from launchableinc/check-order

Merge pull request #856 from launchableinc/check-order #359

# 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- id: run-tagpr
uses: Songmu/tagpr@4c8e0c433614e5915a7049413885246b854dfd4e # v1.2.0
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/action-discord@0.3.2
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 }}'