-
-
Notifications
You must be signed in to change notification settings - Fork 36
79 lines (76 loc) · 2.12 KB
/
artifacts-cd.yml
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
74
75
76
77
78
79
name: Artifacts CD
on:
workflow_dispatch:
push:
branches:
- master
- dev
paths-ignore:
- '**.md'
jobs:
frontend:
name: Build Frontend Artifacts
runs-on: ubuntu-latest
steps:
- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
working-directory: ./web
run: yarn
- name: Build Web App
working-directory: ./web
run: yarn run build --base=/
- name: Upload Artifcats
uses: actions/upload-artifact@v4
with:
name: frontend
path: web/dist/web
backend:
name: Build Backend Artifacts
runs-on: ubuntu-latest
needs:
- frontend
strategy:
matrix:
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: '^1.21'
- name: Check out code
uses: actions/checkout@v2
- name: Retrieve frontend files
uses: actions/download-artifact@v2
with:
name: frontend
path: internal/util/embedded/webdist
- name: Get dependencies
run: go get -v ./...
- name: Populate info embeds
run: bash ./ci/populateinfo.sh
- name: Build Backend (${{ matrix.goos }}-${{ matrix.goarch }})
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -o ./bin/shinpuru-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/shinpuru/main.go
- name: Rename Windows Binary
if: ${{ matrix.goos == 'windows' }}
env:
FNAME: ./bin/shinpuru-${{ matrix.goos }}-${{ matrix.goarch }}
run: mv ${{ env.FNAME }} ${{ env.FNAME }}.exe
- name: Upload Artifcats
uses: actions/upload-artifact@v4
with:
name: shinpuru-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin/