-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (100 loc) · 3.08 KB
/
spa-server-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
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
name: spa-server release
on:
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
jobs:
client:
strategy:
fail-fast: false
matrix:
settings:
- os: ubuntu-latest
name: linux-spa-client
bash: make release-linux-client-musl
- os: macos-latest
name: mac-spa-client
bash: make release-client-mac
- os: windows-latest
name: windows-spa-client
bash: make release-client-win
runs-on: ${{ matrix.settings.os }}
steps:
- name: Get version
uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
- name: Setup MUSL
if: matrix.settings.os == 'ubuntu-latest'
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get -qq install musl-tools
- name: Build Release
run: ${{ matrix.settings.bash }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./release/*
name: ${{ matrix.settings.name }}
if-no-files-found: error
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
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 spa-server
uses: docker/build-push-action@v2
with:
context: .
#platforms: linux/amd64,linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.REGISTRY }}/fornetcode/spa-server:${{github.ref_name}}, ${{ env.REGISTRY }}/fornetcode/spa-server:latest
# - name: build and push spa-server with S3
# uses: docker/build-push-action@v2
# with:
# context: "{{defaultContext}}:docker"
# file: S3FS.Dockerfile
# push: true
# cache-from: type=gha
# cache-to: type=gha,mode=max
# tags: ${{ env.REGISTRY }}/fornetcode/spa-server:${{github.event.inputs.version}}-s3
binFile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
- name: Setup MUSL
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get -qq install musl-tools
- name: Build Release Linux
run: make release-linux-server-musl
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./release/*
name: spa-server-linux-musl
if-no-files-found: error
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
artifacts: spa-server-*
token: ${{ secrets.YOUR_GITHUB_TOKEN }}
draft: true