Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checksum step for release workflow #102

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
tags:
- 'v*'
- "v*"

name: Build Release

Expand All @@ -15,25 +15,25 @@ permissions:
jobs:
release:
name: Create Release
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
strategy:
matrix:
goosarch:
- 'darwin/amd64'
- 'darwin/arm64'
- 'linux/amd64'
- 'linux/arm64'
- 'linux/ppc64le'
- 'linux/s390x'
- 'windows/amd64'
- "darwin/amd64"
- "darwin/arm64"
- "linux/amd64"
- "linux/arm64"
- "linux/ppc64le"
- "linux/s390x"
- "windows/amd64"
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
- name: Get OS and arch info
run: |
GOOSARCH=${{matrix.goosarch}}
Expand All @@ -47,15 +47,24 @@ jobs:
BINARY_NAME=alizer-$RELEASE_VERSION-$GOOS-$GOARCH
fi
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "HASHFILE_NAME=$BINARY_NAME.sha256" >> $GITHUB_ENV
echo "GOOS=$GOOS" >> $GITHUB_ENV
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
- name: Build
run: |
go build -o "$BINARY_NAME" -v
go build -o ${{env.BINARY_NAME}} -v
- name: Generate sha256 checksum
uses: jmgilman/actions-generate-checksum@3ea6dc9bf8eecf28e2ecc982fab683484a1a8561 # v1.0.1
with:
output: ${{env.HASHFILE_NAME}}
method: sha256
patterns: ${{env.BINARY_NAME}}
- name: Release with Notes and Binaries
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
draft: false
files: ${{env.BINARY_NAME}}
files: |
${{env.BINARY_NAME}}
${{env.HASHFILE_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading