-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.6 KB
/
core-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
})