Skip to content

Commit

Permalink
Merge pull request #4 from brown-ccv/update-build-release
Browse files Browse the repository at this point in the history
ci: add configuration for building and publishing the package
  • Loading branch information
hollandjg authored Aug 8, 2024
2 parents 7e7f7e5 + 8ad3b2c commit 80d7f73
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 31 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
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/*
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
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/
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 80d7f73

Please sign in to comment.