-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (33 loc) · 928 Bytes
/
publish.yaml
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
---
name: Publish
on:
push:
tags:
- v*
permissions:
contents: read
id-token: write
jobs:
pypi:
name: PyPi Publish
runs-on: ubuntu-24.04
environment:
name: release
url: https://pypi.org/project/hv4gha/
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Poetry
run: pipx install poetry
- name: Output expected packge version refs/tags/
id: expected
run: echo "tagref=refs/tags/v$(poetry version --short)" >> "$GITHUB_OUTPUT"
- name: Fail on mismatch between tag and package version
if: github.ref != steps.expected.outputs.tagref
run: echo "Mismatch between pushed tag and package version"; exit 1
- name: Build package
run: poetry build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1