Skip to content

Commit

Permalink
fix: update release pipeline to generate proper checksums
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiiakozlova245 committed Feb 1, 2024
1 parent 3fe85e2 commit 8a7630a
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:
jobs:
goreleaser:
name: 'Release the latest tag'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,22 +28,34 @@ jobs:
args: release --clean -f ${{ vars.GORELEASER_CONFIG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.TOFUENV_GITHUB_TOKEN }}
checksums:
name: 'Generate release checksums'
needs: goreleaser
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: robinraju/release-downloader@v1.9
with:
tag: ${{ github.ref_name }}
tarBall: true
zipBall: true
run: |
curl -L --output test-goreleaser-$(echo $TAG | sed s/v//).tar.gz \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://github.com/$GITHUB_REPOSITORY/archive/refs/tags/$TAG.tar.gz
curl -L --output test-goreleaser-$(echo $TAG | sed s/v//).zip \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://github.com/$GITHUB_REPOSITORY/archive/refs/tags/$TAG.zip
env:
GITHUB_TOKEN: ${{ secrets.TOFUENV_GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
- name: Check contents
run: ls -la
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
*.zip
*.tar.gz
method: sha256
output: checksums_${{ github.ref_name }}.txt
run: |
shasum -a 256 *.tar.gz >> checksums_$version.txt
shasum -a 256 *.zip >> checksums_$version.txt
env:
version: ${{ github.ref_name }}
- name: Upload checksum to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down

0 comments on commit 8a7630a

Please sign in to comment.