generated from pypa/sampleproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from brown-ccv/update-build-release
ci: add configuration for building and publishing the package
- Loading branch information
Showing
3 changed files
with
69 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
merge_group: | ||
types: [ checks_requested ] | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build SDist & wheel | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/* | ||
|
||
check: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: validate SDist & wheel | ||
run: pipx run twine check dist/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
|
||
build-and-check: | ||
uses: ./.github/workflows/build.yml | ||
|
||
publish: | ||
needs: [ build-and-check ] | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
- name: Publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true | ||
repository-url: https://test.pypi.org/legacy/ |
This file was deleted.
Oops, something went wrong.