8000 fix: release assets upload by mayeut · Pull Request #285 · actions/python-versions · GitHub
[go: up one dir, main page]

Skip to content

fix: release assets upload #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build-python-packages.yml
4AC6
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,18 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
for (let artifactDir of fs.readdirSync('.')) {
let artifactName = fs.lstatSync(artifactDir).isDirectory() ? fs.readdirSync(`${artifactDir}`)[0] : artifactDir;

const assert = require('assert');
for (let artifactName of fs.readdirSync('.')) {
assert(fs.lstatSync(artifactName).isFile());
console.log(`Upload ${artifactName} asset`);
const isHashes = artifactName === 'hashes.sha256';
const data = fs.readFileSync(artifactName);
github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ steps.create_release.outputs.id }},
name: artifactName,
data: fs.lstatSync(artifactDir).isDirectory() ? fs.readFileSync(`./${artifactDir}/${artifactName}`) : fs.readFileSync(`./${artifactName}`).toString()
data: isHashes ? data.toString() : data
});
}

Expand Down
Loading
0