Skip to content

Commit

Permalink
Added test build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Apr 20, 2023
1 parent 49858c0 commit 8738f3f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ jobs:
flags: python-${{ matrix.python-version }}
verbose: true # optional (default = false)
env_vars: OS,PYTHON

# Upload to Test PyPI.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}

- name: Package
uses: hynek/build-and-inspect-python-package@v1

- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
27 changes: 6 additions & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ on:
push:
tags: ["*"]
workflow_dispatch:
inputs:
tag_name:
description: The name of the tag to release
type: string
required: true

jobs:
# Package when a new tag is pushed
build-package:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -21,10 +25,10 @@ jobs:
# Create a GitHub release
release:
name: Create a GitHub release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build-package
steps:
- uses: actions/checkout@v3
- name: Parse changelog
shell: bash
run: |
Expand Down Expand Up @@ -70,25 +74,6 @@ jobs:
tag_name: "${{ env.TAG_NAME }}"
body: "${{ env.RELEASE_NOTES }}"

# Upload to Test PyPI.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build-package
steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

# Upload to real PyPI on GitHub Releases.
release-pypi:
name: Publish released package to pypi.org
Expand Down

0 comments on commit 8738f3f

Please sign in to comment.