Skip to content

Commit 8738f3f

Browse files
committed
Added test build to CI
1 parent 49858c0 commit 8738f3f

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

.github/workflows/ci.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,21 @@ jobs:
5454
flags: python-${{ matrix.python-version }}
5555
verbose: true # optional (default = false)
5656
env_vars: OS,PYTHON
57+
58+
# Upload to Test PyPI.
59+
release-test-pypi:
60+
name: Publish in-dev package to test.pypi.org
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v3
64+
with:
65+
token: ${{ secrets.PAT }}
66+
67+
- name: Package
68+
uses: hynek/build-and-inspect-python-package@v1
69+
70+
- name: Upload package to Test PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1
72+
with:
73+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
74+
repository-url: https://test.pypi.org/legacy/

.github/workflows/release.yaml

+6-21
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ on:
33
push:
44
tags: ["*"]
55
workflow_dispatch:
6+
inputs:
7+
tag_name:
8+
description: The name of the tag to release
9+
type: string
10+
required: true
611

712
jobs:
813
# Package when a new tag is pushed
914
build-package:
10-
if: startsWith(github.ref, 'refs/tags/')
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v3
@@ -21,10 +25,10 @@ jobs:
2125
# Create a GitHub release
2226
release:
2327
name: Create a GitHub release
24-
if: startsWith(github.ref, 'refs/tags/')
2528
runs-on: ubuntu-latest
2629
needs: build-package
2730
steps:
31+
- uses: actions/checkout@v3
2832
- name: Parse changelog
2933
shell: bash
3034
run: |
@@ -70,25 +74,6 @@ jobs:
7074
tag_name: "${{ env.TAG_NAME }}"
7175
body: "${{ env.RELEASE_NOTES }}"
7276

73-
# Upload to Test PyPI.
74-
release-test-pypi:
75-
name: Publish in-dev package to test.pypi.org
76-
if: startsWith(github.ref, 'refs/tags/')
77-
runs-on: ubuntu-latest
78-
needs: build-package
79-
steps:
80-
- name: Download packages built by build-and-inspect-python-package
81-
uses: actions/download-artifact@v3
82-
with:
83-
name: Packages
84-
path: dist
85-
86-
- name: Upload package to Test PyPI
87-
uses: pypa/gh-action-pypi-publish@release/v1
88-
with:
89-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
90-
repository-url: https://test.pypi.org/legacy/
91-
9277
# Upload to real PyPI on GitHub Releases.
9378
release-pypi:
9479
name: Publish released package to pypi.org

0 commit comments

Comments
 (0)