mirror of
https://github.com/fumiama/dupimage.git
synced 2026-06-05 02:00:32 +08:00
63 lines
2.4 KiB
YAML
63 lines
2.4 KiB
YAML
name: release
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
jobs:
|
|
my-job:
|
|
name: Build DupImage on Push Tag 🚀
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.18
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cache Go
|
|
id: cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
# A list of files, directories, and wildcard patterns to cache and restore
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
|
|
|
|
- name: Tidy Go modules
|
|
run: go mod tidy
|
|
|
|
- name: Build linux-x64
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/di-linux-x64 -trimpath
|
|
- name: Build linux-x86
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o artifacts/di-linux-x86 -trimpath
|
|
- name: Build windows-x64
|
|
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/di-windows-x64.exe -trimpath
|
|
- name: Build windows-x86
|
|
run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o artifacts/di-windows-x86.exe -trimpath
|
|
- name: Build arm64
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags="-s -w" -o artifacts/di-linux-arm64 -trimpath
|
|
- name: Build armv6
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-s -w" -o artifacts/di-linux-armv6 -trimpath
|
|
- name: Build mips
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=mips go build -ldflags="-s -w" -o artifacts/di-linux-mips -trimpath
|
|
- name: Build mips-softfloat
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags="-s -w" -o artifacts/di-linux-mips-softfloat -trimpath
|
|
- name: Build mipsel
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags="-s -w" -o artifacts/di-linux-mipsel -trimpath
|
|
- name: Build mipsel-softfloat
|
|
run: CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags="-s -w" -o artifacts/di-linux-mipsel-softfloat -trimpath
|
|
|
|
- name: Upload binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: artifacts/di-*
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true |