Skip to content

Commit

Permalink
ci: add sha256 checksums (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan authored Oct 6, 2023
1 parent 5567ad8 commit 72f578d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ jobs:
mv ./target/$TARGET/release/mask ./$NAME/mask
chmod +x ./$NAME/mask
zip -r $NAME.zip $NAME
shasum -a 256 $NAME.zip > $NAME.zip.sha256
- name: Attach the binary to the release
uses: ./.github/actions/attach-release-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
assets: ./*.zip
- name: Attach the checksums to the release
uses: ./.github/actions/attach-release-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
assets: ./*.sha256

release-linux-musl:
runs-on: ubuntu-latest
Expand All @@ -48,12 +55,19 @@ jobs:
mv ./target/$TARGET/release/mask ./$NAME/mask
chmod +x ./$NAME/mask
zip -r $NAME.zip $NAME
shasum -a 256 $NAME.zip > $NAME.zip.sha256
- name: Attach the binary to the release
uses: ./.github/actions/attach-release-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
assets: ./*.zip
- name: Attach the checksums to the release
uses: ./.github/actions/attach-release-assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
assets: ./*.sha256

release-macos-aarch64:
runs-on: macos-latest
Expand Down Expand Up @@ -81,12 +95,18 @@ jobs:
mv ./target/$TARGET/release/mask ./$NAME/mask
chmod +x ./$NAME/mask
zip -r $NAME.zip $NAME
shasum -a 256 $NAME.zip > $NAME.zip.sha256
# NOTE: cannot use the attach-release-assets action because macOS doesn't support docker-based actions.
# Luckily we can just run the bash script directly.
- name: Attach the binary to the release
run: ./.github/actions/attach-release-assets/run.sh ./*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Attach the checksums to the release
shell: bash
run: ./.github/actions/attach-release-assets/run.sh ./*.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-macos-x86-64:
runs-on: macos-latest
Expand All @@ -111,12 +131,18 @@ jobs:
mv ./target/$TARGET/release/mask ./$NAME/mask
chmod +x ./$NAME/mask
zip -r $NAME.zip $NAME
shasum -a 256 $NAME.zip > $NAME.zip.sha256
# NOTE: cannot use the attach-release-assets action because macOS doesn't support docker-based actions.
# Luckily we can just run the bash script directly.
- name: Attach the binary to the release
run: ./.github/actions/attach-release-assets/run.sh ./*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Attach the checksums to the release
shell: bash
run: ./.github/actions/attach-release-assets/run.sh ./*.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-homebrew:
needs: release-macos-x86-64
Expand Down Expand Up @@ -148,10 +174,16 @@ jobs:
mkdir $NAME
mv ./target/$TARGET/release/mask.exe ./$NAME/mask.exe
7z a $NAME.zip $NAME
certutil -hashfile $NAME.zip sha256 | grep -E [A-Fa-f0-9]{64} > $NAME.zip.sha256
# NOTE: cannot use the attach-release-assets action because windows doesn't support docker-based actions.
# Luckily we can just run the bash script directly.
- name: Attach the binary to the release
shell: bash
run: ./.github/actions/attach-release-assets/run.sh ./*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Attach the checksums to the release
shell: bash
run: ./.github/actions/attach-release-assets/run.sh ./*.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 72f578d

Please sign in to comment.