Skip to content

Commit

Permalink
CI - Separate out workflows for building pypi packages per test and r…
Browse files Browse the repository at this point in the history
…elease use cases (#983)
  • Loading branch information
soapy1 authored Nov 18, 2024
1 parent 9941b3f commit 6be6ab5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build_pypi_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Build PyPI package"

on:
pull_request:
paths:
- ".github/workflows/**"
- "conda-store/**"
- "conda-store-server/**"
- "tests/**"
push:
branches:
- main

env:
FORCE_COLOR: "1" # Make tools pretty.

permissions:
contents: read # This is required for actions/checkout

jobs:
# Always build & verify package.
build-package:
name: "Build & verify package"
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- "conda-store"
- "conda-store-server"
defaults:
run:
working-directory: ${{ matrix.directory }}
steps:
- name: "Checkout Repository 🛎"
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: echo "Running on ${{ matrix.directory }}"

- name: "Build and check package - ${{ matrix.directory }} 📦"
uses: hynek/build-and-inspect-python-package@v2
id: baipp
with:
path: ${{ matrix.directory }}
upload-name-suffix: "-${{ matrix.directory }}"

- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }} and in artifact ${{ steps.baipp.outputs.artifact-name }}
6 changes: 1 addition & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: "Build and maybe upload PyPI package"
name: "Build and upload PyPI package"

on:
release:
types: [published]
push:
branches: [main]
tags: ["*"]
pull_request:
branches:
- main
workflow_dispatch:

env:
Expand Down

0 comments on commit 6be6ab5

Please sign in to comment.