-
Notifications
You must be signed in to change notification settings - Fork 4
112 lines (93 loc) · 2.91 KB
/
Copy pathrelease.yml
File metadata and controls
112 lines (93 loc) · 2.91 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: "release-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build:
uses: ./.github/workflows/build.yml
release:
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/ci-setup
- name: "Upgrade dependencies"
run: python3 -m pip install --upgrade twine build
- name: "Build package"
run: |
python3 -m build
- name: "Upload dist as artifact"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist-artifact
path: dist/
- name: "Download artifacts for unit tests"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: unit-test-report
path: reports/unit-test-report
- name: "Download artifacts for coverage"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-report
path: reports/coverage-report
- name: "Download artifacts for lint"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pylint-report
path: reports/pylint-report
- name: "Download artifacts for codestyle"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: codestyle-report
path: reports/codestyle-report
- name: "Compress the artifacts"
run: |
cd reports
zip -r unit-test-report.zip unit-test-report
zip -r coverage-report.zip coverage-report
zip -r pylint-report.zip pylint-report
zip -r codestyle-report.zip codestyle-report
- name: "Package release"
id: package
run: |
gh release upload ${{ github.ref_name }} \
dist/ankaios_sdk-*.tar.gz \
dist/ankaios_sdk-*.whl \
reports/unit-test-report.zip \
reports/coverage-report.zip \
reports/pylint-report.zip \
reports/codestyle-report.zip
publish:
needs: release
environment:
name: pypi
url: https://pypi.org/p/ankaios-sdk
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: "Download dist artifact"
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist-artifact
path: dist
- name: "Publish package to PyPI"
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
attestations: true
docs:
needs: publish
permissions:
pages: write
id-token: write
uses: ./.github/workflows/documentation.yml