-
Notifications
You must be signed in to change notification settings - Fork 18
165 lines (154 loc) · 5.54 KB
/
github-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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Create Github Release
on:
workflow_call:
inputs:
version:
required: true
type: string
jobs:
release:
name: Create Github Release
runs-on: ubuntu-latest
outputs:
url: ${{ steps.output_url.outputs.url }}
steps:
- name: Download Python Build Artifacts
uses: actions/download-artifact@v4
with:
name: Source Tarball
path: dist
- name: Download Python Build Artifacts
uses: actions/download-artifact@v4
with:
name: Python Wheel
path: dist
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: "v${{ inputs.version }}"
release_name: "Release v${{ inputs.version }}"
body: |
Release ${{ needs.build-python-package.outputs.version }}
draft: false
prerelease: false
- name: Upload Source Tarball
id: upload-release-asset-source
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/relenv-${{ inputs.version }}.tar.gz
asset_name: relenv-${{ inputs.version }}.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Wheel
id: upload-release-asset-x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/relenv-${{ inputs.version }}-py3-none-any.whl
asset_name: relenv-${{ inputs.version }}-py3-none-any.whl
asset_content_type: application/zip
- name: Output url
id: output_url
run: echo "url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT
upload-artifacts:
name: Create Github Release
needs: [release]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux-gnu
arch: x86_64
python: 3.10.15
- platform: linux-gnu
arch: x86_64
python: 3.11.10
- platform: linux-gnu
arch: x86_64
python: 3.12.7
- platform: linux-gnu
arch: x86_64
python: 3.13.0
- platform: linux-gnu
arch: aarch64
python: 3.10.15
- platform: linux-gnu
arch: aarch64
python: 3.11.10
- platform: linux-gnu
arch: aarch64
python: 3.12.7
- platform: linux-gnu
arch: aarch64
python: 3.13.0
- platform: win
arch: x86
python: 3.10.15
- platform: win
arch: x86
python: 3.11.10
- platform: win
arch: x86
python: 3.12.7
- platform: win
arch: x86
python: 3.13.0
- platform: win
arch: amd64
python: 3.10.15
- platform: win
arch: amd64
python: 3.11.10
- platform: win
arch: amd64
python: 3.12.7
- platform: win
arch: amd64
python: 3.13.0
- platform: macos
arch: x86_64
python: 3.10.15
- platform: macos
arch: x86_64
python: 3.11.10
- platform: macos
arch: x86_64
python: 3.12.7
- platform: macos
arch: x86_64
python: 3.13.0
- platform: macos
arch: arm64
python: 3.10.15
- platform: macos
arch: arm64
python: 3.11.10
- platform: macos
arch: arm64
python: 3.12.7
- platform: macos
arch: arm64
python: 3.13.0
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
path: ./
- name: Upload ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
id: upload-python-build-assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_name: ${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
asset_path: ./${{ matrix.python }}-${{ matrix.arch }}-${{ matrix.platform }}.tar.xz
asset_content_type: application/tar+xz