1
0
Fork 0
mirror of https://github.com/kou029w/yama.git synced 2025-02-07 09:38:41 +00:00

update actions

This commit is contained in:
Nebel 2022-06-01 11:02:14 +09:00
parent b6009672e1
commit a7f88f0eef
2 changed files with 8 additions and 8 deletions

View file

@ -16,7 +16,7 @@ module.exports = async function ({ github, context, glob }) {
.basename(file) .basename(file)
.replace(/^yama-armhf[.]/, `yama-${version}-armhf.`); .replace(/^yama-armhf[.]/, `yama-${version}-armhf.`);
const data = await fs.readFile(file); const data = await fs.readFile(file);
await github.repos.uploadReleaseAsset({ ...target, name, data }); await github.rest.repos.uploadReleaseAsset({ ...target, name, data });
const hash = crypto.createHash("sha256").update(data).digest("hex"); const hash = crypto.createHash("sha256").update(data).digest("hex");
body = `${body} body = `${body}
${name.split(".").includes("img") ? "OS イメージ" : "ファイルシステム"} ${name.split(".").includes("img") ? "OS イメージ" : "ファイルシステム"}
@ -24,5 +24,5 @@ ${name.split(".").includes("img") ? "OS イメージ" : "ファイルシステ
- ${name} (SHA256: \`${hash}\`) - ${name} (SHA256: \`${hash}\`)
`; `;
} }
await github.repos.updateRelease({ ...target, body, prerelease: false }); await github.rest.repos.updateRelease({ ...target, body, prerelease: false });
}; };

View file

@ -9,7 +9,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: sudo apt-get update
- run: sudo apt-get install -y qemu-user-static - run: sudo apt-get install -y qemu-user-static
- run: sudo bin/build - run: sudo bin/build
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
@ -22,10 +21,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v3
with: { name: yama-armhf } with:
- uses: actions/github-script@v4 name: yama-armhf
- uses: actions/github-script@v6
with: with:
script: | script: |
const script = require("./.github/scripts/release.js"); const release = require("./.github/scripts/release.js");
await script({ github, context, glob }); await release({ github, context, glob });