-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.88 KB
/
release.yaml
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
name: Create Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Tag Name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init
env GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s" -o logicng-service-macos-arm main.go
env GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-macos-intel main.go
env GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-linux-amd64 main.go
env GOOS=linux GOARCH=arm64 go build -ldflags "-w -s" -o logicng-service-linux-arm64 main.go
env GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-win.exe main.go
- name: Build and Push Images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/booleworks/logicng-service:${{ ENV.TAG_NAME }}
platforms: linux/arm64,linux/amd64
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
logicng-service-macos-arm
logicng-service-macos-intel
logicng-service-linux-arm64
logicng-service-linux-amd64
logicng-service-win.exe