-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (109 loc) · 3.96 KB
/
build_publish_pypi_and_draft_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
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
113
114
115
116
117
118
119
120
121
122
# © 2023 SolarWinds Worldwide, LLC. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
name: Publish to PyPi and Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Semantic version of release (e.g. 1.0.0)'
required: true
env:
RELEASE_NAME: rel-${{ github.event.inputs.version }}
permissions:
id-token: write
contents: read
jobs:
is_publishable:
name: Check if version valid
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check version
run: cd .github/scripts && ./is_publishable.sh ${{ github.event.inputs.version }}
get_apm_python_version:
name: Get APM Python version
needs: is_publishable
# Outputs SW_APM_VERSION
uses: ./.github/workflows/get_apm_python_version.yaml
build_sdist_and_x86_64:
name: Build sdist and x86_64
needs: get_apm_python_version
# Outputs artifact-name
uses: ./.github/workflows/build_x86_64.yaml
with:
version: ${{ needs.get_apm_python_version.outputs.sw-apm-version }}
scan_sdist_and_x86_64:
name: RL scan aarch64 build
needs:
- get_apm_python_version
- build_sdist_and_x86_64
uses: ./.github/workflows/reversinglabs_scan.yaml
with:
artifact-name: ${{ needs.build_sdist_and_x86_64.outputs.artifact-name }}
package-name: apm-python-pypi-sdist-x86_64
version: ${{ needs.get_apm_python_version.outputs.sw-apm-version }}
rl-submit-only: false
secrets: inherit
publish_sdist_and_x86_64:
name: Publish sdist and x86_64 to PyPI
needs:
- build_sdist_and_x86_64
- scan_sdist_and_x86_64
uses: ./.github/workflows/publish_x86_64.yaml
with:
artifact-name: ${{ needs.build_sdist_and_x86_64.outputs.artifact-name }}
repository-name: pypi
secrets: inherit
build_aarch64:
name: Build aarch64
needs: get_apm_python_version
# Outputs artifact-name
uses: ./.github/workflows/build_aarch64.yaml
with:
version: ${{ needs.get_apm_python_version.outputs.sw-apm-version }}
scan_aarch64:
name: RL scan aarch64 build
needs:
- get_apm_python_version
- build_aarch64
uses: ./.github/workflows/reversinglabs_scan.yaml
with:
artifact-name: ${{ needs.build_aarch64.outputs.artifact-name }}
package-name: apm-python-pypi-aarch64
version: ${{ needs.get_apm_python_version.outputs.sw-apm-version }}
rl-submit-only: false
secrets: inherit
publish_aarch64:
name: Publish aarch64 to PyPI
needs:
- build_aarch64
- scan_aarch64
uses: ./.github/workflows/publish_aarch64.yaml
with:
artifact-name: ${{ needs.build_aarch64.outputs.artifact-name }}
repository-name: pypi
secrets: inherit
create_release:
name: Create draft release
needs: [publish_sdist_and_x86_64, publish_aarch64]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: getsentry/action-github-app-token@v3
id: github-token
with:
app_id: ${{ vars.APPLICATION_ID }}
private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- uses: actions/checkout@v4
- name: Initialize git
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Create draft release
run: gh release create ${{ env.RELEASE_NAME }} --title "${{ env.RELEASE_NAME }}" --target release/${{ env.RELEASE_NAME }} --draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}