Skip to content

Commit

Permalink
Fix publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirostar committed Apr 19, 2023
1 parent 0ace00d commit 9e124f6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ jobs:
run: gradle build

- name: Upload release assets
uses: actions/github-script@v2
uses: actions/github-script@v6
with:
github-token: ${{github.token}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const fs = require('fs');
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
Expand All @@ -52,7 +51,7 @@ jobs:
'dcm4che-typeddicom-generator/dcm4che-typeddicom-java-generator-gradleplugin'
];
for (project of publishableSubProjects) {
fs.readdir("./" + project + '/build/libs', (err, files) => {
fs.readdir(`./${project}/build/libs`, (err, files) => {
if (err) {
console.log(err);
} else {
Expand All @@ -61,12 +60,12 @@ jobs:
const releaseAssetName = file.replace(/(.*?)(-\d+\.\d+\.\d+(-SNAPSHOT)?)?(-(javadoc|sources))?.jar/, "$1/$1-${{ steps.get_release.outputs.tag_name }}$4.jar");
console.log('uploading ' + file + ' > ' + releaseAssetName);
github.repos.uploadReleaseAsset({
github.rest.repos.uploadReleaseAsset({
owner,
repo,
release_id: steps.get_release.outputs.id,
name: releaseAssetName,
data: await fs.readFile(`./${file}`)
data: fs.readFileSync(`./${project}/build/libs/${file}`)
});
});
}
Expand Down

0 comments on commit 9e124f6

Please sign in to comment.