-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (80 loc) · 2.43 KB
/
build.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: build and upload artifacts
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
workflow_call:
inputs:
tag_name:
type: string
description: "The tag name of the release without v prefix"
env:
VERSION: ${{ inputs.tag_name }}
jobs:
build:
name: build and upload artifacts
strategy:
matrix:
include:
- os: windows-2022
arch: amd64
target: windows
ext: .exe
- os: ubuntu-20.04
arch: amd64
target: linux
- os: ubuntu-20.04
arch: arm64
target: linux
- os: macos-13
arch: amd64
target: darwin
- os: macos-14
arch: arm64
target: darwin
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./server
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: installing dependencies
uses: ./.github/actions/install
with:
os: ${{ matrix.os }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if VERSION exists
shell: bash
id: check_version
run: |
if [ ! -z "${{ env.VERSION }}" ]; then
echo "PRODUCTION=true" >> $GITHUB_ENV
fi
- name: Build CLI
shell: bash
run: task build:cli
env:
OS: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
- name: Rename CLI artifact
run: mv build/deweb-cli${{ matrix.ext }} build/deweb-cli_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}
- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: deweb-cli_${{ matrix.target }}_${{ matrix.arch }}
path: build/deweb-cli_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}
- name: Build Server
shell: bash
run: task build:server
env:
OS: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
- name: Rename Server artifact
run: mv build/deweb-server${{ matrix.ext }} build/deweb-server_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}
- name: Upload Server artifact
uses: actions/upload-artifact@v4
with:
name: deweb-server_${{ matrix.target }}_${{ matrix.arch }}
path: build/deweb-server_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}