diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f2f2699..10f71305 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,7 @@ jobs: path: age-* upload: name: Upload release binaries - if: ${{ github.event_name == 'release' }} + if: github.event_name == 'release' needs: build permissions: contents: write @@ -75,26 +75,7 @@ jobs: with: name: age-binaries - name: Upload release artifacts - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require("fs").promises; - const { repo: { owner, repo }, sha } = context; - - const release = await github.repos.getReleaseByTag({ - owner, repo, - tag: process.env.GITHUB_REF.replace("refs/tags/", ""), - }); - console.log("Release:", { release }); - - for (let file of await fs.readdir(".")) { - if (!file.startsWith("age-")) continue; - console.log("Uploading", file); - await github.repos.uploadReleaseAsset({ - owner, repo, - release_id: release.data.id, - name: file, - data: await fs.readFile(file), - }); - } + run: gh release upload "$GITHUB_REF_NAME" age-* + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }}