Skip to content

add .github/workflows/release.yml #2

add .github/workflows/release.yml

add .github/workflows/release.yml #2

Workflow file for this run

name: patch-release
on:
push:
tags:
- 'v*-patch-release'
jobs:
build:
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
# Include amd64 and arm64 on all platforms.
goos: [windows, freebsd, linux, darwin]
goarch: [amd64, arm64]
fail-fast: false
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
steps:
- name: Checkout codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Show workflow information
id: get_filename
run: |
echo "ASSET_NAME=cfssl-${{ github.ref_name }}-${GOOS}-${GOARCH}" >> $GITHUB_OUTPUT
echo "ASSET_NAME=cfssl-${{ github.ref_name }}-${GOOS}-${GOARCH}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Build
run: make all
- name: Rename Windows binary
if: matrix.goos == 'windows'
run: |
cd ./bin || exit 1
for binary in cfssl cfssl-bundle cfssl-certinfo cfssl-newkey cfssl-scan cfssljson mkbundle multirootca; do
mv ${binary} ${binary}.exe
done
- name: Create ZIP archive
run: |
pushd ./bin || exit 1
zip -9vr ../${ASSET_NAME}.zip .
popd || exit 1
FILE=./${ASSET_NAME}.zip
DGST=${FILE}.dgst
openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST
openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST
- name: Upload files to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: ./${{ steps.get_filename.outputs.ASSET_NAME }}.zip*
tag: ${{ github.ref }}