-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (120 loc) · 3.79 KB
/
client_build.yml
File metadata and controls
123 lines (120 loc) · 3.79 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: fornet client build
on:
workflow_dispatch:
inputs:
version:
required: true
description: "docker version to release"
env:
REGISTRY: ghcr.io
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GithubPackages
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: build and push docker image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
file: command/docker/client/client.Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}}, ${{ env.REGISTRY }}/fornetcode/fornet:latest
UnixCommandLine:
strategy:
max-parallel: 1
fail-fast: true
matrix:
settings:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: make release-linux
- host: macos-latest
target: x86_64-apple-darwin
build: make release-mac-x86_64
- host: macos-13-xlarge
target: aarch64-apple-darwin
build: make release-mac-aarch64
# - host: macos-latest # This needs aarch64 OpenSSL, will wait github action support MacOS M1(https://github.com/github/roadmap/issues/528), then run this.
# target: aarch64-apple-darwin
# build: make release-mac-aarch64
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.settings.target }}
profile: minimal
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
client/target/
key: ${{ matrix.settings.host }}-${{ matrix.settings.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ matrix.settings.host }}-cargo-${{ matrix.settings.target }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Build
run: ${{ matrix.settings.build }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: fornet-${{ matrix.settings.target }}
path: release/*
if-no-files-found: error
WindowsCommandLine:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
profile: minimal
- name: Set up cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
client/target/
key: windows-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: windows-cargo
- name: build
shell: pwsh
run: ./windows-build.ps1
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: fornet-win11-x86_64
path: release/*
if-no-files-found: error