forked from ms/transocks
81 lines
2.2 KiB
YAML
81 lines
2.2 KiB
YAML
name: build
|
|
|
|
run-name: ${{ gitea.actor }} build Transocks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
tags-ignore:
|
|
- "v*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: check-out
|
|
uses: https://git.mousesoft.ru/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: set-up go
|
|
uses: https://git.mousesoft.ru/actions/setup-go@v3
|
|
with:
|
|
go-version: ">=1.22"
|
|
|
|
- name: set-up dependencies
|
|
run: |
|
|
go install github.com/kisielk/errcheck@latest
|
|
go install honnef.co/go/tools/cmd/staticcheck@latest
|
|
go install github.com/sashamelentyev/usestdlibvars@latest
|
|
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
|
|
make vendor
|
|
|
|
- name: lint
|
|
run: make lint
|
|
|
|
- name: golangci-lint
|
|
uses: https://github.com/golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.60
|
|
|
|
- name: build linux amd64
|
|
id: build-amd64
|
|
run: |
|
|
echo "ARTIFACT=transocks-$(make version)_$(go env GOOS)-amd64" >> $GITHUB_OUTPUT
|
|
GOARCH=amd64 make clean build
|
|
|
|
- name: upload linux amd64
|
|
uses: https://git.mousesoft.ru/actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.build-amd64.outputs.ARTIFACT }}
|
|
path: out/bin/*
|
|
overwrite: true
|
|
|
|
- name: build linux arm64
|
|
id: build-arm64
|
|
run: |
|
|
echo "ARTIFACT=transocks-$(make version)_$(go env GOOS)-arm64" >> $GITHUB_OUTPUT
|
|
GOARCH=arm64 make clean build
|
|
|
|
- name: upload linux arm64
|
|
uses: https://git.mousesoft.ru/actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.build-arm64.outputs.ARTIFACT }}
|
|
path: out/bin/*
|
|
overwrite: true
|
|
|
|
- name: build linux arm32
|
|
id: build-arm32
|
|
run: |
|
|
echo "ARTIFACT=transocks-$(make version)_$(go env GOOS)-arm32" >> $GITHUB_OUTPUT
|
|
GOARCH=arm make clean build
|
|
|
|
- name: upload linux arm32
|
|
uses: https://git.mousesoft.ru/actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.build-arm32.outputs.ARTIFACT }}
|
|
path: out/bin/*
|
|
overwrite: true
|