add todo section #56
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
name: pipeline | |
on: [push] | |
jobs: | |
pre-job: | |
runs-on: ubuntu-latest | |
outputs: | |
cache_key: ${{ steps.set_cache_key.outputs.key }} | |
steps: | |
- name: Print current job number | |
run: echo "Current job number is ${{ github.run_number }}" | |
- id: set_cache_key | |
run: echo "key=dist-${{ github.run_number }}" >> $GITHUB_OUTPUT | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: pre-job | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11.4 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build | |
run: make build | |
- name: Print current cache key | |
run: echo "Current cache key is ${{ needs.pre-job.outputs.cache_key }}" | |
- name: Cache the build artifacts | |
uses: actions/cache@v3 | |
with: | |
path: dist | |
key: ${{ needs.pre-job.outputs.cache_key }} | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- pre-job | |
- build | |
if: startsWith(github.ref, 'refs/tags') | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print current cache key | |
run: echo "Current cache key is ${{ needs.pre-job.outputs.cache_key }}" | |
- name: Restore build artifacts | |
uses: actions/cache@v3 | |
with: | |
path: dist | |
key: ${{ needs.pre-job.outputs.cache_key }} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
release: | |
if: contains(github.ref, 'refs/tags/') | |
needs: | |
- pre-job | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print current cache key | |
run: echo "Current cache key is ${{ needs.pre-job.outputs.cache_key }}" | |
- name: Restore build artifacts | |
uses: actions/cache@v3 | |
with: | |
path: dist | |
key: ${{ needs.pre-job.outputs.cache_key }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
files: dist/*.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |