From a7f88f0eeff9853504bb68b6d6edc2fe7ed5c66a Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 1 Jun 2022 11:02:14 +0900 Subject: [PATCH] update actions --- .github/scripts/release.js | 4 ++-- .github/workflows/build.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/scripts/release.js b/.github/scripts/release.js index 589c876..e03ae36 100644 --- a/.github/scripts/release.js +++ b/.github/scripts/release.js @@ -16,7 +16,7 @@ module.exports = async function ({ github, context, glob }) { .basename(file) .replace(/^yama-armhf[.]/, `yama-${version}-armhf.`); 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"); body = `${body} ${name.split(".").includes("img") ? "OS イメージ" : "ファイルシステム"} @@ -24,5 +24,5 @@ ${name.split(".").includes("img") ? "OS イメージ" : "ファイルシステ - ${name} (SHA256: \`${hash}\`) `; } - await github.repos.updateRelease({ ...target, body, prerelease: false }); + await github.rest.repos.updateRelease({ ...target, body, prerelease: false }); }; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2545437..b2d4697 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: sudo apt-get update - run: sudo apt-get install -y qemu-user-static - run: sudo bin/build - uses: actions/upload-artifact@v2 @@ -22,10 +21,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: { name: yama-armhf } - - uses: actions/github-script@v4 + - uses: actions/download-artifact@v3 + with: + name: yama-armhf + - uses: actions/github-script@v6 with: script: | - const script = require("./.github/scripts/release.js"); - await script({ github, context, glob }); + const release = require("./.github/scripts/release.js"); + await release({ github, context, glob });