Skip to content

Commit

Permalink
Updated CI Workflows for Releases (#1167)
Browse files Browse the repository at this point in the history
* updated workflows

* updated permissions
  • Loading branch information
srivarra authored Oct 10, 2024
1 parent 2f8b2bd commit e22a487
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.whl
path: dist/*
34 changes: 19 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ concurrency:

permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT

jobs:
test:
name: Test
permissions:
contents: read
secrets: inherit
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT
uses: ./.github/workflows/test.yml

build:
name: Build distribution 📦
uses: ./.github/workflows/build.yml
secrets: inherit
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT
uses: ./.github/workflows/build.yml

publish-to-testpypi:
# Test PyPI publish, requires wheels and source dist to pass
Expand All @@ -40,19 +45,20 @@ jobs:
url: https://test.pypi.org/p/ark-analysis

permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # Necessary for trusted publishing

steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist
name: dist
path: dist/

- name: Publish distributions 📦 to TestPyPI
run:
uv publish --publish-url https://test.pypi.org/legacy/
uses: pypa/gh-action-pypi-publish@release/v1.9
with:
repository-url: https://test.pypi.org/legacy/


publish-to-pypi:
Expand All @@ -67,21 +73,20 @@ jobs:
url: https://pypi.org/p/ark-analysis

permissions:
id-token: write
contents: read # to fetch code (actions/checkout)
id-token: write # Necessary for trusted publishing

# Publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
name: dist
path: dist/

- name: Publish Distributions 📦 to PyPI
run: |
uv publish
uses: pypa/gh-action-pypi-publish@release/v1.9


github-release-upload-dists:
Expand All @@ -99,8 +104,7 @@ jobs:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
name: dist
path: dist/

- name: Sign the dists with Sigstore
Expand Down

0 comments on commit e22a487

Please sign in to comment.