Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
radusuciu committed Feb 27, 2024
1 parent d4e720b commit 14ecde7
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,39 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
environment: pypi-publish

env:
VIRTUAL_ENV: .venv
permissions:
# for trusted publishing
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.11
python-version: '3.11'
cache: true

- name: Install dependencies
run: pdm install -v --dev

run: |
python -m venv ${{ env.VIRTUAL_ENV }}
pdm sync --verbose --dev
- name: Run tests
run: python -m pytest

run: |
source ${{ env.VIRTUAL_ENV }}/bin/activate
python -m pytest
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref }}
tag_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Build and publish to PyPI
env:
PDM_PUBLISH_USERNAME: ${{ secrets.PDM_PUBLISH_USERNAME }}
PDM_PUBLISH_PASSWORD: ${{ secrets.PDM_PUBLISH_PASSWORD }}
run: |
source ${{ env.VIRTUAL_ENV }}/bin/activate
pdm publish

0 comments on commit 14ecde7

Please sign in to comment.