Skip to content

Commit

Permalink
Move publish to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Jan 3, 2023
1 parent 646e212 commit 0508de5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Publish package

on:
workflow_call:
secrets:
registry_token:
description: The package registry token.
required: true

jobs:
publish:
name: Publish package
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}
path: dist/
- name: Publish
run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD
env:
USERNAME: __token__
PASSWORD: ${{ secrets.registry_token }}
22 changes: 3 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,7 @@ jobs:
files: dist/*
pypi:
name: PyPI
runs-on: ubuntu-latest
timeout-minutes: 30
uses: ./.github/workflows/publish-package.yml
needs: artifacts
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}
path: dist/
- name: Publish
run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD
env:
USERNAME: __token__
PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
secrets:
registry_token: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 0508de5

Please sign in to comment.