forked from Threadfin/Threadfin
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (67 loc) · 2.43 KB
/
release.yml
File metadata and controls
73 lines (67 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Threadfin Build
on:
push:
tags: "1.*"
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: main
- name: Set up and Build
uses: actions/setup-go@v3
with:
go-version: 1.22
id: go
- name: Build Binaries
run: |
go mod tidy && go mod vendor
echo "Building Linux"
env GOOS=linux GOARCH=arm64 go build -o dist/Threadfin_linux_arm64
env GOOS=linux GOARCH=arm go build -o dist/Threadfin_linux_arm
env GOOS=linux GOARCH=amd64 go build -o dist/Threadfin_linux_amd64
echo "Building FreeBSD"
env GOOS=freebsd GOARCH=amd64 go build -o dist/Threadfin_freebsd_amd64
env GOOS=freebsd GOARCH=arm go build -o dist/Threadfin_freebsd_arm
echo "Building Macos"
env GOOS=darwin GOARCH=arm64 go build -o dist/Threadfin_darwin_arm64
env GOOS=darwin GOARCH=amd64 go build -o dist/Threadfin_darwin_amd64
echo "Building Windows"
env GOOS=windows GOARCH=amd64 go build -o dist/Threadfin_windows_amd64.exe
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Build Setup
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
- name: Docker Build and Push
uses: docker/build-push-action@v4
with:
context: .
push: true
no-cache: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
tags: fyb3roptik/threadfin:latest,fyb3roptik/threadfin:${{ github.ref_name }}
- name: Docker Nvidia Build and Push
uses: docker/build-push-action@v4
with:
context: .
build-args: NVIDIA=1
push: true
no-cache: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8
tags: fyb3roptik/threadfin:latest-nvidia,fyb3roptik/threadfin:${{ github.ref_name }}-nvidia
- name: Release
uses: "ModeSevenIndustrialSolutions/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: dist/*