Compare commits

...

4 Commits

Author SHA1 Message Date
aaf95da610 Fix workflow 2024-08-27 23:59:35 -07:00
834ac8f3fc body_file → body-file 2024-08-27 22:29:35 -07:00
9cdbef73aa try main branch yaclog 2024-08-27 22:19:46 -07:00
93439d0827 rework CI 2024-08-27 22:18:14 -07:00
2 changed files with 64 additions and 47 deletions

64
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,64 @@
# 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
name: build
on: [ push, pull_request ]
jobs:
build:
name: Build Distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.12'
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/
- uses: actions/upload-artifact@v4
with:
name: python-distribution
path: dist/
compression-level: 0 # already compressed
publish:
name: Deploy to PyPI and Github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-22.04
environment:
name: Publish
url: https://pypi.org/project/yaclog-ksp/${{ github.ref_name }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: python-distribution
path: dist/
- name: Get Changelog Information
id: yaclog-show
uses: drewcassidy/yaclog@1.4.3
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to Github
run: >
gh release create ${{ github.ref_name }}
--notes-file "${{ steps.yaclog-show.outputs.body-file }}"
--title "${{ steps.yaclog-show.outputs.name }}"
dist/*
env:
GH_TOKEN: ${{ github.token }}

View File

@ -1,47 +0,0 @@
# 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
name: Deploy
on: [ push ]
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/yaclog-ksp
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '>=3.8'
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a Binary Wheel and Source Tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Get Changelog Information
uses: drewcassidy/yaclog@1.4.2
id: yaclog-show
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to Github
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/*
env:
GH_TOKEN: ${{ github.token }}