Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 34b7771

Browse files
committed
Update build-wheel.yaml
1 parent eda826d commit 34b7771

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/build-wheel.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# template version 2022.4
1+
# template version 2023.2
22

33
name: Build Python wheel for Alpine Linux
44

@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
image_tag:
21-
- 3.10-alpine
21+
- 3.11-alpine
2222

2323
steps:
2424

@@ -33,24 +33,30 @@ jobs:
3333
- name: Get file name and sha256 of asset
3434
id: asset
3535
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
3939
4040
- name: Show sha256 of asset
4141
run: shasum -a 256 ${{ github.workspace }}/${{ steps.asset.outputs.filename }}
4242

4343
- name: Upload asset to release
4444
id: upload
4545
if: github.event_name == 'release'
46-
uses: actions/[email protected]
47-
env:
48-
GITHUB_TOKEN: ${{ github.token }}
46+
uses: actions/github-script@v6
4947
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);
5460
5561
- name: Send repository dispatch to package index
5662
if: github.event_name == 'release'

0 commit comments

Comments
 (0)