Skip to content

Commit 10a10e7

Browse files
authored
Pass tag to workflow call (#5)
1 parent e0c7fd6 commit 10a10e7

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ on:
77
pull_request:
88
branches: [ "main", "v*" ]
99
workflow_dispatch:
10+
inputs:
11+
tag:
12+
description: tag to build
13+
required: false
14+
type: string
1015
workflow_call:
16+
inputs:
17+
tag:
18+
description: tag to build
19+
required: true
20+
type: string
1121

1222
permissions:
1323
contents: read
@@ -35,6 +45,8 @@ jobs:
3545
- "pypy-3.9"
3646
steps:
3747
- uses: "actions/checkout@v3"
48+
with:
49+
ref: ${{ inputs.tag || github.ref }}
3850
- uses: "actions/setup-python@v4"
3951
with:
4052
python-version: "${{ matrix.python-version }}"
@@ -52,6 +64,8 @@ jobs:
5264
needs: tests
5365
steps:
5466
- uses: "actions/checkout@v3"
67+
with:
68+
ref: ${{ inputs.tag || github.ref }}
5569
- uses: "actions/setup-python@v4"
5670
with:
5771
python-version: "3.10"

.github/workflows/pypi.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ on:
2323
jobs:
2424
tests:
2525
uses: ./.github/workflows/main.yml
26+
with:
27+
tag: ${{ inputs.tag }}
2628
pypi:
2729
name: Build and upload to PyPI
2830
runs-on: ubuntu-latest
@@ -31,7 +33,7 @@ jobs:
3133
- name: Checkout
3234
uses: actions/checkout@v3
3335
with:
34-
ref: ${{ inputs.tag || github.ref }}
36+
ref: ${{ inputs.tag }}
3537
- name: Set up Python 3.10
3638
uses: actions/setup-python@v4
3739
with:
@@ -45,13 +47,13 @@ jobs:
4547
- name: "Run twine check"
4648
run: "python -m twine check dist/*"
4749
- name: Publish distribution to Test PyPI
48-
uses: pypa/gh-action-pypi-publish@master
50+
uses: pypa/gh-action-pypi-publish@release/v1
4951
with:
5052
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
5153
repository_url: https://test.pypi.org/legacy/
5254
if: inputs.testpypi || false
5355
- name: Publish distribution to PyPI
54-
uses: pypa/gh-action-pypi-publish@master
56+
uses: pypa/gh-action-pypi-publish@release/v1
5557
with:
5658
password: ${{ secrets.PYPI_API_TOKEN }}
5759
if: inputs.pypi || false

0 commit comments

Comments
 (0)