-
Notifications
You must be signed in to change notification settings - Fork 53
71 lines (59 loc) · 1.85 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (59 loc) · 1.85 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
name: release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Gitleaks scan
uses: gitleaks/gitleaks-action@v2
with:
config-path: .gitleaks.toml
- name: Build autoar-web
working-directory: autoar-web
run: |
go mod tidy
GOOS=linux GOARCH=amd64 go build -o build/autoar-web-linux-amd64 ./cmd/server
GOOS=linux GOARCH=arm64 go build -o build/autoar-web-linux-arm64 ./cmd/server
GOOS=darwin GOARCH=amd64 go build -o build/autoar-web-darwin-amd64 ./cmd/server
GOOS=darwin GOARCH=arm64 go build -o build/autoar-web-darwin-arm64 ./cmd/server
GOOS=windows GOARCH=amd64 go build -o build/autoar-web-windows-amd64.exe ./cmd/server
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
autoar-web/build/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- 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 and push
uses: docker/build-push-action@v5
with:
context: .
file: autoar-web/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/autoar-web:${{ github.ref_name }}