-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (86 loc) · 2.72 KB
/
release.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release
on:
workflow_run:
workflows: [Validate]
types:
- completed
branches:
- main
permissions:
id-token: write
contents: write
jobs:
publish-sdk-coverage:
name: Publish SDK test coverage
timeout-minutes: 5
runs-on: ubuntu-latest
environment: main
steps:
- name: Download coverage percentage
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: sdk-coverage
- run: awk '{print "COVERAGE_PCT=" $1}' sdk-coverage.txt >> $GITHUB_ENV
- uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_ACCESS_TOKEN }}
gistID: a9b9bfdfa0620696fba9e76223790f53
filename: sdk-coverage.json
label: SDK coverage
message: ${{ env.COVERAGE_PCT }}
minColorRange: 50
maxColorRange: 80
valColorRange: ${{ env.COVERAGE_PCT }}
publish-cli-coverage:
name: Publish CLI test coverage
runs-on: ubuntu-latest
environment: main
steps:
- name: Download coverage percentage
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: cli-coverage
- run: awk '{print "COVERAGE_PCT=" $1}' cli-coverage.txt >> $GITHUB_ENV
- uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_ACCESS_TOKEN }}
gistID: a9b9bfdfa0620696fba9e76223790f53
filename: cli-coverage.json
label: CLI coverage
message: ${{ env.COVERAGE_PCT }}
minColorRange: 50
maxColorRange: 80
valColorRange: ${{ env.COVERAGE_PCT }}
release:
name: Release
runs-on: ubuntu-latest
environment: main
timeout-minutes: 15
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
- name: Download build artifact
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
name: package
path: dist
- run: pip install python-semantic-release==9.6.0 twine==5.0.0
- run: |
semantic-release version --commit --tag --push
semantic-release publish
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
- run: twine upload --skip-existing --non-interactive dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}