-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (48 loc) · 1.69 KB
/
release.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Note: The name of this file and the name of the used environment must match the Trusted Publisher
# configuration on PyPI.
---
name: "Release"
on: workflow_dispatch
jobs:
tests:
uses: ./.github/workflows/tests.yaml
release:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: write
needs: [tests]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- run: uv sync
- run: uv build
- run: tar --create --gzip --verbose --file dist.tar.gz dist
- name: "Set release according to package version"
id: compute-tag
run: |
version="$(uv tree | grep --regexp "^robotframework-robotmklibrary v.*" | cut --delimiter " " --fields 2)"
echo "TAG=${version}" >> "${GITHUB_OUTPUT}"
- name: "Push release tag"
# This is publicly visible and needs to be manually fixed if any
# consecutive step fails.
run: |
git tag ${{ steps.compute-tag.outputs.TAG }} # Fails, if tag exists.
git push origin ${{ steps.compute-tag.outputs.TAG }}
- uses: ncipollo/release-action@v1
with:
allowUpdates: false
artifacts: "dist.tar.gz"
replacesArtifacts: true
removeArtifacts: true
prerelease: true
draft: true
body: ""
artifactErrorsFailBuild: true
updateOnlyUnreleased: true
makeLatest: false
tag: ${{ steps.compute-tag.outputs.TAG }}
- uses: pypa/gh-action-pypi-publish@release/v1