Skip to content

Commit 71a9c00

Browse files
committed
add spa-server bin file github action
1 parent 7b6cc17 commit 71a9c00

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

.github/workflows/spa-server-docker-cd.yml .github/workflows/spa-server-cd.yml

+37-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ jobs:
1616
- uses: actions/checkout@v3
1717
with:
1818
submodules: true
19-
# -
20-
# name: Set up QEMU
21-
# uses: docker/setup-qemu-action@v1
2219
-
2320
name: Set up Docker Buildx
2421
uses: docker/setup-buildx-action@v2
@@ -48,4 +45,40 @@ jobs:
4845
# push: true
4946
# cache-from: type=gha
5047
# cache-to: type=gha,mode=max
51-
# tags: ${{ env.REGISTRY }}/fornetcode/spa-server:${{github.event.inputs.version}}-s3
48+
# tags: ${{ env.REGISTRY }}/fornetcode/spa-server:${{github.event.inputs.version}}-s3
49+
binFile:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
with:
54+
submodules: true
55+
- name: Install Rust
56+
uses: actions-rs/toolchain@v1
57+
with:
58+
toolchain: stable
59+
60+
- name: Cache cargo registry
61+
uses: actions/cache@v2
62+
with:
63+
path: ~/.cargo/registry
64+
key: cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
65+
66+
- name: Cache cargo index
67+
uses: actions/cache@v2
68+
with:
69+
path: ~/.cargo/git
70+
key: cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
71+
72+
- name: Setup MUSL
73+
run: |
74+
rustup target add x86_64-unknown-linux-musl
75+
sudo apt-get -qq install musl-tools
76+
77+
- name: Build Release Linux
78+
run: make release-linux-server-musl
79+
80+
- name: Upload artifact
81+
uses: actions/upload-artifact@v2
82+
with:
83+
path: ./release/*
84+
if-no-files-found: error

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ release-linux-musl: build-linux-musl-release
5151
mkdir -p release
5252
tar -C ./target/x86_64-unknown-linux-musl/release/ -czvf ./release/spa-client-linux-musl.tar.gz ./spa-client
5353

54+
release-linux-server-musl:
55+
cargo build --package spa-client --bin spa-client --target=x86_64-unknown-linux-musl --release
56+
strip target/x86_64-unknown-linux-musl/release/spa-server
57+
mkdir -p release
58+
tar -C ./target/x86_64-unknown-linux-musl/release/ -czvf ./release/spa-server-linux-musl.tar.gz ./spa-server
59+
60+
61+

0 commit comments

Comments
 (0)