yaclog-ksp/.github/workflows/python-publish.yml

47 lines
1.4 KiB
YAML
Raw Normal View History

2021-04-17 05:24:44 +00:00
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
2024-08-27 06:40:54 +00:00
name: Deploy
on: [ push ]
2021-04-17 05:24:44 +00:00
jobs:
deploy:
runs-on: ubuntu-latest
2021-05-07 21:29:14 +00:00
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
2024-08-27 06:40:54 +00:00
environment:
name: pypi
url: https://pypi.org/p/yaclog-ksp
permissions:
id-token: write
2024-08-27 08:16:59 +00:00
contents: write
2021-04-17 05:24:44 +00:00
steps:
- uses: actions/checkout@v4
2021-04-17 05:24:44 +00:00
- name: Set up Python
2024-08-27 06:40:54 +00:00
uses: actions/setup-python@v5.1.1
2021-04-17 05:24:44 +00:00
with:
2024-08-27 06:40:54 +00:00
python-version: '>=3.8'
2021-04-17 05:24:44 +00:00
- name: Install pypa/build
run: python -m pip install build --user
2024-08-27 06:40:54 +00:00
- name: Build a Binary Wheel and Source Tarball
2021-04-17 05:24:44 +00:00
run: python -m build --sdist --wheel --outdir dist/
2024-08-27 06:40:54 +00:00
- name: Get Changelog Information
2024-08-27 08:16:59 +00:00
uses: drewcassidy/yaclog@1.4.2
2024-08-27 06:40:54 +00:00
id: yaclog-show
2021-05-07 21:29:14 +00:00
2021-04-17 05:24:44 +00:00
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2021-05-07 21:29:14 +00:00
- name: Publish to Github
2024-08-27 06:40:54 +00:00
run: |
gh release create ${{ github.ref_name }} \
--notes-file "${{ steps.yaclog-show.outputs.body_file }}" \
--title "${{ steps.yaclog-show.outputs.name }}"
gh release upload ${{ github.ref_name }} dist/*
2021-05-07 21:29:14 +00:00
env:
2024-08-27 06:40:54 +00:00
GH_TOKEN: ${{ github.token }}