Skip to content

Commit

Permalink
fix/migrate-to-trusted-publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver committed Nov 5, 2024
1 parent 575f938 commit 5dc74b7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
runs-on: ubuntu-20.04

if: contains(fromJson('["refs/heads/main", "refs/heads/binaries-fixes"]'), github.ref) || startsWith(github.ref, 'refs/tags')

steps:
- name: Slack trigger
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

build-binaries:
needs: test
Expand Down Expand Up @@ -84,13 +84,17 @@ jobs:


deploy-pypi:
needs: build-binaries
runs-on: ubuntu-20.04

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

needs: build-binaries
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/safety
permissions:
id-token: write # Required for trusted publishing
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -101,11 +105,8 @@ jobs:
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.SAFETY_PYPI_API_TOKEN }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

create-gh-release:
needs: deploy-pypi
Expand Down

0 comments on commit 5dc74b7

Please sign in to comment.