Skip to content

Publish pgscatalog.utils #12

Publish pgscatalog.utils

Publish pgscatalog.utils #12

Workflow file for this run

name: Publish pgscatalog.utils
on:
workflow_dispatch:
inputs:
package-directory:
type: choice
options:
- pgscatalog.utils
python-version:
required: false
type: choice
options:
- "3.11"
jobs:
publish:
name: build and publish utils package
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write
outputs:
tag: ${{ steps.package-tag.outputs.TAG_NAME }}
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
id: package-tag
run: |
echo "TAG_NAME=$(poetry version | tr -s ' ' '-')" >> "$GITHUB_OUTPUT"
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/${{ steps.package-tag.outputs.TAG_NAME }}',
sha: context.sha
})
publish_images:
name: publish container images
uses: ./.github/workflows/utils-build-publish.yml
needs: publish
with:
tag: ${{ needs.publish.outputs.tag }}