Skip to content

Commit 0508de5

Browse files
committed
Move publish to reusable workflow
1 parent 646e212 commit 0508de5

File tree

2 files changed

+35
-19
lines changed

2 files changed

+35
-19
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Publish package
3+
4+
on:
5+
workflow_call:
6+
secrets:
7+
registry_token:
8+
description: The package registry token.
9+
required: true
10+
11+
jobs:
12+
publish:
13+
name: Publish package
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Setup
20+
uses: ./.github/actions/setup
21+
with:
22+
install_dependencies: 'false'
23+
- name: Download artifacts
24+
uses: actions/download-artifact@v3
25+
with:
26+
name: ${{ github.sha }}
27+
path: dist/
28+
- name: Publish
29+
run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD
30+
env:
31+
USERNAME: __token__
32+
PASSWORD: ${{ secrets.registry_token }}

.github/workflows/publish.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,7 @@ jobs:
4848
files: dist/*
4949
pypi:
5050
name: PyPI
51-
runs-on: ubuntu-latest
52-
timeout-minutes: 30
51+
uses: ./.github/workflows/publish-package.yml
5352
needs: artifacts
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@v3
57-
- name: Setup
58-
uses: ./.github/actions/setup
59-
with:
60-
install_dependencies: 'false'
61-
- name: Download artifacts
62-
uses: actions/download-artifact@v3
63-
with:
64-
name: ${{ github.sha }}
65-
path: dist/
66-
- name: Publish
67-
run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD
68-
env:
69-
USERNAME: __token__
70-
PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
53+
secrets:
54+
registry_token: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)