new project structure #20
Workflow file for this run
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
name: Build package | |
on: | |
workflow_call: | |
pull_request: | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
jobs: | |
linters: | |
uses: ./.github/workflows/lint.yml | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
WHL: ${{ steps.filenames.outputs.WHL }} | |
TARGZ: ${{ steps.filenames.outputs.TARGZ }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Setup hatch | |
run: python -m pip install hatch | |
- name: Set new version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
python -m hatch version ${GITHUB_REF/refs\/tags\/v/} | |
- name: Build package | |
run: python -m hatch build | |
- name: Set filenames in output | |
id: filenames | |
run: | | |
echo WHL=$(echo dist/*.whl) >> $GITHUB_OUTPUT | |
echo TARGZ=$(echo dist/*.tar.gz) >> $GITHUB_OUTPUT | |
- name: Archive package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: distributions | |
path: dist | |
retention-days: 5 |