1
- # template version 2022.4
1
+ # template version 2023.2
2
2
3
3
name : Build Python wheel for Alpine Linux
4
4
18
18
strategy :
19
19
matrix :
20
20
image_tag :
21
- - 3.10 -alpine
21
+ - 3.11 -alpine
22
22
23
23
steps :
24
24
@@ -33,24 +33,30 @@ jobs:
33
33
- name : Get file name and sha256 of asset
34
34
id : asset
35
35
run : |
36
- echo "::set-output name= package_name:: $(awk -F '==' '{ print $1 }' requirements.txt)"
37
- echo "::set-output name= filename:: $(ls *.whl)"
38
- echo "::set-output name= sha256:: $(shasum -a 256 *.whl | awk '{ print $1 }')"
36
+ echo "package_name= $(awk -F '==' '{ print $1 }' requirements.txt)" >> $GITHUB_OUTPUT
37
+ echo "filename= $(ls *.whl)" >> $GITHUB_OUTPUT
38
+ echo "sha256= $(shasum -a 256 *.whl | awk '{ print $1 }')" >> $GITHUB_OUTPUT
39
39
40
40
- name : Show sha256 of asset
41
41
run : shasum -a 256 ${{ github.workspace }}/${{ steps.asset.outputs.filename }}
42
42
43
43
- name : Upload asset to release
44
44
id : upload
45
45
if : github.event_name == 'release'
46
-
47
- env :
48
- GITHUB_TOKEN : ${{ github.token }}
46
+ uses : actions/github-script@v6
49
47
with :
50
- asset_content_type : application/octet-stream
51
- asset_path : ${{ github.workspace }}/${{ steps.asset.outputs.filename }}
52
- asset_name : ${{ steps.asset.outputs.filename }}
53
- upload_url : ${{ github.event.release.upload_url }}
48
+ script : |
49
+ const fs = require('node:fs/promises');
50
+ const data = await fs.readFile('${{ github.workspace }}/${{ steps.asset.outputs.filename }}');
51
+ const repository = '${{ github.repository }}';
52
+ const { data: releaseAsset } = await github.rest.repos.uploadReleaseAsset({
53
+ owner: '${{ github.repository_owner }}',
54
+ repo: repository.split('/')[1],
55
+ release_id: '${{ github.event.release.id }}',
56
+ name: '${{ steps.asset.outputs.filename }}',
57
+ data: data
58
+ });
59
+ core.setOutput('browser_download_url', releaseAsset.browser_download_url);
54
60
55
61
- name : Send repository dispatch to package index
56
62
if : github.event_name == 'release'
0 commit comments