Skip to content

Commit

Permalink
chore: Update release.yml and python-package.yml
Browse files Browse the repository at this point in the history
Move all code related to publishing from python-package.yml to release.yml
  • Loading branch information
pbrod committed Oct 3, 2024
1 parent 127ccf6 commit f95a408
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
31 changes: 1 addition & 30 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This workflow will do Continous Integration (CI) and Continous Deployment (CD).
# It will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see:
# https://py-pkgs.org/08-ci-cd
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: ci-cd
name: test

# Controls when the workflow will run
on: [push, pull_request]
Expand Down Expand Up @@ -33,31 +32,3 @@ jobs:
- name: Run Tests
run: |
pdm run pytest
pypi-publish:
needs: ci
# Only run this job if new work is pushed to the "master" branch
if: github.event_name == 'push' && github.ref == 'refs/heads/master1'

name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# This permission is needed for private repositories.
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
url: https://pypi.org/p/nvector

steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4

- name: Publish release distributions to PyPI
run: pdm publish

13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@


on:
release:
release: # Will run when you publish a release on this site.
types: [published]


Expand All @@ -12,10 +14,17 @@ jobs:
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
url: https://pypi.org/p/nvector

steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4

- name: Publish package distributions to PyPI
run: pdm publish
run: pdm publish

0 comments on commit f95a408

Please sign in to comment.