From cafa34158fe29337f33098f2385a056ee312e3b2 Mon Sep 17 00:00:00 2001 From: hantmac Date: Wed, 6 Nov 2024 16:23:17 +0800 Subject: [PATCH] fix --- .github/workflows/release.yaml | 35 +++++++++------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ed4f644..a2d599c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -88,45 +88,28 @@ jobs: upload-sha256sums: needs: build_and_upload runs-on: ubuntu-latest + name: upload-sha256sums steps: + - name: Checkout + uses: actions/checkout@v4 - name: Get release id: get_release uses: bruceadams/get-release@v1.2.2 - - name: Download sha256sums - uses: actions/download-artifact@v4 + - name: Download artifacts + uses: actions/download-artifact@v4.1.7 with: pattern: sha256sums-* merge-multiple: true - - name: Combine sha256sums + path: sha256sums + - shell: bash run: | - cat sha256-*.txt > sha256sums.txt - - name: Delete existing sha256sums - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const release = await github.rest.repos.getReleaseByTag({ - owner: context.repo.owner, - repo: context.repo.repo, - tag: '${{ github.ref_name }}' - }); - for (const asset of release.data.assets) { - if (asset.name === 'sha256sums.txt') { - await github.rest.repos.deleteReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, - asset_id: asset.id - }); - console.log('Deleted existing sha256sums.txt'); - break; - } - } + cat sha256sums/*.txt > sha256sums.txt - name: Upload Checksums uses: actions/upload-release-asset@v1.0.2 with: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_path: sha256sums.txt - asset_name: sha256sums.txt + asset_name: sha256sums-${{ steps.get_release.outputs.tag_name }}.txt asset_content_type: text/plain - name: Update kubectl plugin version in krew-index uses: rajatjindal/krew-release-bot@v0.0.43