generated from alpine-wheels/_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eda826d
commit 34b7771
Showing
1 changed file
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# template version 2022.4 | ||
# template version 2023.2 | ||
|
||
name: Build Python wheel for Alpine Linux | ||
|
||
|
@@ -18,7 +18,7 @@ jobs: | |
strategy: | ||
matrix: | ||
image_tag: | ||
- 3.10-alpine | ||
- 3.11-alpine | ||
|
||
steps: | ||
|
||
|
@@ -33,24 +33,30 @@ jobs: | |
- name: Get file name and sha256 of asset | ||
id: asset | ||
run: | | ||
echo "::set-output name=package_name::$(awk -F '==' '{ print $1 }' requirements.txt)" | ||
echo "::set-output name=filename::$(ls *.whl)" | ||
echo "::set-output name=sha256::$(shasum -a 256 *.whl | awk '{ print $1 }')" | ||
echo "package_name=$(awk -F '==' '{ print $1 }' requirements.txt)" >> $GITHUB_OUTPUT | ||
echo "filename=$(ls *.whl)" >> $GITHUB_OUTPUT | ||
echo "sha256=$(shasum -a 256 *.whl | awk '{ print $1 }')" >> $GITHUB_OUTPUT | ||
- name: Show sha256 of asset | ||
run: shasum -a 256 ${{ github.workspace }}/${{ steps.asset.outputs.filename }} | ||
|
||
- name: Upload asset to release | ||
id: upload | ||
if: github.event_name == 'release' | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
uses: actions/github-script@v6 | ||
with: | ||
asset_content_type: application/octet-stream | ||
asset_path: ${{ github.workspace }}/${{ steps.asset.outputs.filename }} | ||
asset_name: ${{ steps.asset.outputs.filename }} | ||
upload_url: ${{ github.event.release.upload_url }} | ||
script: | | ||
const fs = require('node:fs/promises'); | ||
const data = await fs.readFile('${{ github.workspace }}/${{ steps.asset.outputs.filename }}'); | ||
const repository = '${{ github.repository }}'; | ||
const { data: releaseAsset } = await github.rest.repos.uploadReleaseAsset({ | ||
owner: '${{ github.repository_owner }}', | ||
repo: repository.split('/')[1], | ||
release_id: '${{ github.event.release.id }}', | ||
name: '${{ steps.asset.outputs.filename }}', | ||
data: data | ||
}); | ||
core.setOutput('browser_download_url', releaseAsset.browser_download_url); | ||
- name: Send repository dispatch to package index | ||
if: github.event_name == 'release' | ||
|