Skip to content

Commit

Permalink
Merge pull request #54 from tofuutils/fix/checksums
Browse files Browse the repository at this point in the history
fix: update release pipeline to generate proper checksums
  • Loading branch information
anastasiiakozlova245 authored Feb 1, 2024
2 parents 3fe85e2 + b7d2afe commit 936f4c6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .changelog/46.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
fix: update checksums generation
```
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/[email protected]
with:
tag: ${{ github.ref_name }}
tarBall: true
zipBall: true
run: |
curl -L --output tofuenv-$(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 tofuenv-$(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 936f4c6

Please sign in to comment.