Publish pgscatalog.core #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish pgscatalog.core | |
on: | |
workflow_dispatch: | |
inputs: | |
package-directory: | |
type: choice | |
options: | |
- pgscatalog.core | |
python-version: | |
required: false | |
type: choice | |
options: | |
- "3.11" | |
jobs: | |
publish: | |
name: build and publish core package | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ inputs.python-version }} | |
- name: Python Poetry Action | |
uses: abatilo/[email protected] | |
- name: Build package | |
run: poetry build --no-interaction | |
working-directory: ${{inputs.package-directory}} | |
- name: Publish package distributions | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: ${{inputs.package-directory}}/dist | |
skip-existing: false | |
- name: Read package version | |
run: | | |
echo "TAG_NAME=$(poetry version | tr -s ' ' '-')" >> $GITHUB_ENV | |
working-directory: ${{inputs.package-directory}} | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ env.TAG_NAME }}', | |
sha: context.sha | |
}) | |