Merge pull request #159 from backend-developers-ltd/always_on #4
Workflow file for this run
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: "CD: library" | |
on: | |
push: | |
tags: 'library-v*' # push events to matching v*, i.e. v1.0, v20.15.10 | |
env: | |
PYTHON_DEFAULT_VERSION: "3.11" | |
jobs: | |
deploy: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
id-token: write # allows publishing to PyPI | |
contents: write # allows uploading a GitHub release | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./compute_horde | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Install dependencies | |
run: python -m pip install --upgrade nox 'pdm>=2.12,<3' | |
- name: Get version from tag | |
id: get-version | |
run: echo "version=${GITHUB_REF#refs/tags/library-v}" >> "$GITHUB_OUTPUT" | |
# - name: Read the Changelog | |
# id: read-changelog | |
# uses: mindsers/changelog-reader-action@v2 | |
# with: | |
# version: ${{ steps.get-version.outputs.version }} | |
# path: ./compute_horde/CHANGELOG.md | |
- name: Build | |
run: pdm build | |
- name: Create GitHub release and upload the distribution | |
id: create-release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ steps.get-version.outputs.version }} | |
body: ${{ steps.read-changelog.outputs.changes }} | |
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }} | |
prerelease: false | |
files: ./compute_horde/dist/* | |
- name: Upload the distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: ./compute_horde/dist/ |