Skip to content

Commit 2a3c919

Browse files
committed
update
1 parent faca2dd commit 2a3c919

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/pypi.yml

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

913
jobs:
1014
pypi:
@@ -16,6 +20,8 @@ jobs:
1620
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1721
steps:
1822
- uses: actions/checkout@v4
23+
with:
24+
ref: ${{ inputs.ref || github.ref }}
1925
- uses: actions/setup-python@v5
2026
- run: pip install build twine && make dist
2127
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tag.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tag every commit
1+
name: Tag and Publish every commit
22

33
on:
44
push:
@@ -9,18 +9,24 @@ on:
99
jobs:
1010
tag:
1111
runs-on: ubuntu-latest
12+
outputs:
13+
tag: ${{ steps.tag.outputs.new_tag }}
1214
permissions:
1315
contents: write
16+
environment:
17+
name: pypi
18+
url: https://pypi.org/p/sphinxnotes-project
1419
steps:
1520
- uses: actions/checkout@v4
1621
with:
1722
fetch-depth: '0'
1823
- uses: anothrNick/github-tag-action@v1
24+
id: tag
1925
env:
2026
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2127
CUSTOM_TAG: 1.0a${{ github.run_number }}
2228
publish:
2329
uses: ./.github/workflows/pypi.yml
2430
needs: tag
2531
with:
26-
github_ref: 1.0a${{ github.run_number }}
32+
ref: ${{ needs.tag.outputs.tag }}

0 commit comments

Comments
 (0)