-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
- 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/[email protected] | ||
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/[email protected] |