Redo workflow

why do I do this to myself
This commit is contained in:
Andrew Cassidy 2024-08-27 21:18:50 -07:00
parent 0ca8609bb7
commit e31a8d094e

View File

@ -6,7 +6,8 @@ on: [ push, pull_request ]
jobs: jobs:
test: test:
runs-on: ubuntu-latest name: Test Python Module
runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
@ -39,28 +40,24 @@ jobs:
- name: Run Unit Tests - name: Run Unit Tests
run: python -m unittest -v run: python -m unittest -v
- name: Run Action build:
id: yaclog-show name: Build Distribution
uses: ./
deploy:
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') outputs:
environment: body_file: ${{ steps.yaclog-show.outputs.body_file }}
name: pypi version_name: ${{ steps.yaclog-show.outputs.name }}
url: https://pypi.org/p/yaclog
permissions:
id-token: write
contents: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5.1.1 uses: actions/setup-python@v5.1.1
with: with:
python-version: '>=3.8' python-version: '3.12'
- name: Get Changelog Information
id: yaclog-show
uses: ./ # self-hosting!
- name: Install pypa/build - name: Install pypa/build
run: python -m pip install build --user run: python -m pip install build --user
@ -68,20 +65,52 @@ jobs:
- name: Build a binary wheel and source tarball - name: Build a binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/ run: python -m build --sdist --wheel --outdir dist/
- name: Get Changelog Information - uses: actions/upload-artifact@v4
id: yaclog-show with:
uses: ./ name: python-distribution
# self-hosting! path: dist/
compression-level: 0 # already compressed
publish-pypi:
name: Deploy to PyPI
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/${{ github.ref_name }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: python-distribution
path: dist/
- name: Publish to PyPI - name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1 uses: pypa/gh-action-pypi-publish@release/v1
publish-github:
name: Deploy to Github
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-22.04
environment:
name: Publish
url: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: python-distribution
path: dist/
- name: Publish to Github - name: Publish to Github
run: | run: >
gh release create ${{ github.ref_name }} \ gh release create ${{ github.ref_name }}
--notes-file "${{ steps.yaclog-show.outputs.body_file }}" \ --notes-file "${{ needs.build.outputs.body_file }}"
--title "${{ steps.yaclog-show.outputs.name }}" --title "${{ needs.build.outputs.version_name }}"
dist/*
gh release upload ${{ github.ref_name }} dist/*
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}