Build static binaries #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-release | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-go@v1 | |
with: | |
go-version: '1.20.3' # The Go version to download (if necessary) and use. | |
- name: Build all platforms | |
run: | | |
make | |
- name: Package Linux AMD64 | |
run: | | |
rm -rf package | |
mkdir -p package/ssl-pairgen | |
cp -a target/ssl-pairgen_linux-amd64 package/ssl-pairgen/ssl-pairgen | |
cp -a README.md LICENSE kube-ca.sh package/ssl-pairgen | |
cd package | |
tar czvf ../ssl-pairgen-linux-amd64.tar.gz ssl-pairgen | |
- name: Package Linux ARM64 | |
run: | | |
rm -rf package | |
mkdir -p package/ssl-pairgen | |
cp -a target/ssl-pairgen_linux-arm64 package/ssl-pairgen/ssl-pairgen | |
cp -a README.md LICENSE kube-ca.sh package/ssl-pairgen | |
cd package | |
tar czvf ../ssl-pairgen-linux-arm64.tar.gz ssl-pairgen | |
- name: Package Darwin AMD64 | |
run: | | |
rm -rf package | |
mkdir -p package/ssl-pairgen | |
cp -a target/ssl-pairgen_darwin-amd64 package/ssl-pairgen/ssl-pairgen | |
cp -a README.md LICENSE kube-ca.sh package/ssl-pairgen | |
cd package | |
tar czvf ../ssl-pairgen-darwin-amd64.tar.gz ssl-pairgen | |
- name: Package Darwin ARM64 | |
run: | | |
rm -rf package | |
mkdir -p package/ssl-pairgen | |
cp -a target/ssl-pairgen_darwin-arm64 package/ssl-pairgen/ssl-pairgen | |
cp -a README.md LICENSE kube-ca.sh package/ssl-pairgen | |
cd package | |
tar czvf ../ssl-pairgen-darwin-arm64.tar.gz ssl-pairgen | |
- name: Calculate SHA-256 checksums | |
run: | | |
shasum -a 256 ssl-pairgen-linux-amd64.tar.gz > ssl-pairgen-linux-amd64.tar.gz.sha256 | |
shasum -a 256 ssl-pairgen-linux-arm64.tar.gz > ssl-pairgen-linux-arm64.tar.gz.sha256 | |
shasum -a 256 ssl-pairgen-darwin-amd64.tar.gz > ssl-pairgen-darwin-amd64.tar.gz.sha256 | |
shasum -a 256 ssl-pairgen-darwin-arm64.tar.gz > ssl-pairgen-darwin-arm64.tar.gz.sha256 | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
# softprops/action-gh-release v0.1.12 | |
uses: softprops/action-gh-release@2d72d869af3bf23602f9593a1e3fd739b80ac1eb | |
with: | |
files: | | |
ssl-pairgen-linux-amd64.tar.gz | |
ssl-pairgen-linux-arm64.tar.gz | |
ssl-pairgen-darwin-amd64.tar.gz | |
ssl-pairgen-darwin-arm64.tar.gz | |
ssl-pairgen-linux-amd64.tar.gz.sha256 | |
ssl-pairgen-linux-arm64.tar.gz.sha256 | |
ssl-pairgen-darwin-amd64.tar.gz.sha256 | |
ssl-pairgen-darwin-arm64.tar.gz.sha256 |