Skip to content

v0.2.2

v0.2.2 #21

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.23.0]
os: [linux]
arch: [amd64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod tidy
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 1
run: |
CGO_ENABLED=1 CGO_LDFLAGS="-L/usr/lib" go build -o output/${{ matrix.os }}_${{ matrix.arch }}/preen --ldflags="-extldflags=-static" -tags osusergo,netgo main.go
tar -C output/${{ matrix.os }}_${{ matrix.arch }} -czvf preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz preen
echo "Built for $GOOS $GOARCH"
- name: Generate checksum
run: |
sha256sum preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz | tee preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.sha256sum
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
file: preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
- name: Upload checksum
uses: svenstaro/upload-release-action@v2
with:
file: preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.sha256sum
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
build-macos:
runs-on: macos-latest
strategy:
matrix:
go-version: [1.23.0]
os: [darwin]
arch: [arm64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod tidy
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 1
run: |
CGO_ENABLED=1 CGO_LDFLAGS="-L/usr/lib" go build -o output/${{ matrix.os }}_${{ matrix.arch }}/preen main.go
tar -C output/${{ matrix.os }}_${{ matrix.arch }} -czvf preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz preen
echo "Built for $GOOS $GOARCH"
- name: Generate checksum
run: |
shasum -a 256 preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz | tee preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.sha256sum
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
file: preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
- name: Upload checksum
uses: svenstaro/upload-release-action@v2
with:
file: preen-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.sha256sum
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}