fix - fix ci

This commit is contained in:
regevbr 2023-05-22 21:29:20 +03:00
parent 6295ff030e
commit e225e77501
No known key found for this signature in database
GPG Key ID: 47F0B00C687E259E
6 changed files with 6765 additions and 1723 deletions

View File

@ -39,20 +39,18 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs')
const child_process = require('child_process');
const assert = require('assert').strict;
const expected = fs.readFileSync("README.md")
const expected = fs.readFileSync("README.md", "utf-8")
const release = await github.repos.getReleaseByTag({
...context.repo,
tag: "ci-test-${{ matrix.os }}-${{ github.run_id }}",
})
assert.deepStrictEqual(release.data.prerelease, true)
assert.deepStrictEqual(release.data.make_latest, true)
assert.deepStrictEqual(release.data.body, "rofl lol test\nianal % fubar")
assert.deepStrictEqual(release.data.assets[0].name, "TEST.md")
const actual = child_process.execSync(`curl -Ls ${release.data.assets[0].browser_download_url}`)
assert.deepStrictEqual(expected, actual)
const actual = await github.request(release.data.assets[0].browser_download_url)
assert.deepStrictEqual(expected, actual.data)
- name: Clean up
if: ${{ always() }}
uses: actions/github-script@v2

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ node_modules
run.sh
__tests__/runner/*
lib/**/*
.idea

2104
dist/index.js vendored

File diff suppressed because it is too large Load Diff

6366
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,11 +28,13 @@
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5",
"@actions/github": "^5.1.1",
"@lifeomic/attempt": "^3.0.3",
"@octokit/core": "^4.2.1",
"glob": "^7"
},
"devDependencies": {
"@octokit/types": "^9.2.3",
"@types/glob": "^7",
"@types/jest": "^29",
"@types/node": "^16",

View File

@ -45,7 +45,7 @@ async function get_release_by_tag(
...repo(),
tag_name: tag,
prerelease: prerelease,
make_latest: make_latest,
make_latest: make_latest ? 'true' : 'false',
name: release_name,
body: body
})
@ -73,7 +73,6 @@ async function upload_to_release(
core.debug(`Skipping ${file}, since its size is 0`)
return
}
const file_bytes: any = fs.createReadStream(file)
// Check for duplicates.
const assets: RepoAssetsResp = await octokit.paginate(repoAssets, {
@ -108,7 +107,7 @@ async function upload_to_release(
release_id: release.data.id,
url: release.data.upload_url,
name: asset_name,
data: file_bytes,
data: fs.createReadStream(file) as any,
headers: {
'content-type': 'binary/octet-stream',
'content-length': file_size