Skip to content

Commit 29773de

Browse files
committed
reuse
1 parent d540c20 commit 29773de

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

.github/workflows/pypi.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
tags:
66
- "*"
7+
workflow_call: # can be triggered by other actions
8+
inputs:
9+
ref:
10+
required: true
11+
type: string
712

813
jobs:
914
pypi:
@@ -15,6 +20,8 @@ jobs:
1520
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1621
steps:
1722
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.ref || github.ref }}
1825
- uses: actions/setup-python@v5
1926
- run: pip install build twine && make dist
2027
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tag.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
name: Tag every commit
1+
name: Tag and Publish every commit
22

33
on:
44
push:
55
branches:
66
- master
7+
- tag-every-commit
78

89
jobs:
9-
build:
10+
tag:
1011
runs-on: ubuntu-latest
12+
outputs:
13+
tag: ${{ steps.tag.outputs.new_tag }}
1114
permissions:
1215
contents: write
1316
steps:
1417
- uses: actions/checkout@v4
1518
with:
1619
fetch-depth: '0'
1720
- uses: anothrNick/github-tag-action@v1
21+
id: tag
1822
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
20-
TAG_PREFIX:
21-
INITIAL_VERSION: 1.1.0
22-
PRERELEASE: true
23-
PRERELEASE_SUFFIX: a
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
CUSTOM_TAG: 1.0a${{ github.run_number }}
25+
publish:
26+
uses: ./.github/workflows/pypi.yml
27+
needs: tag
28+
with:
29+
ref: ${{ needs.tag.outputs.tag }}

0 commit comments

Comments
 (0)