This repository was archived by the owner on May 27, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 - os : ubuntu-latest
3535 rid : linux-x64
3636 binary-extension : ' '
37-
37+
38+ env :
39+ RUNTIME_IDENTIFIER : ${{ matrix.rid }}
40+
41+ steps :
42+ - name : Install Linux Dependencies
43+ if : matrix.os == 'ubuntu-latest'
44+ run : sudo apt-get update && sudo apt-get install -y clang zlib1g-dev
45+
46+ - name : Setup .NET SDK
47+ uses : actions/setup-dotnet@v4
48+ with :
49+ dotnet-version : ' 9.0.x'
50+
51+ - name : Checkout code
52+ uses : actions/checkout@v4
53+
54+ - name : Publish
55+ run : dotnet publish Lagrange.Milky -c Release -r ${{ matrix.rid }}
56+
57+ - name : Upload artifacts
58+ if : github.event_name != 'pull_request'
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : Lagrange.Milky-${{ matrix.rid }}
62+ path : Lagrange.Milky/bin/Release/net9.0/${{ matrix.rid }}/publish/Lagrange.Milky${{ matrix.binary-extension }}name: Build Lagrange.Milky
63+
64+ on :
65+ push :
66+ branches : [ main ]
67+ paths :
68+ - Lagrange.Codec/**
69+ - Lagrange.Core/**
70+ - Lagrange.Proto/**
71+ - Lagrange.Proto.Generator/**
72+ - Lagrange.Milky/**
73+ pull_request :
74+ branches : [ main ]
75+ paths :
76+ - Lagrange.Codec/**
77+ - Lagrange.Core/**
78+ - Lagrange.Proto/**
79+ - Lagrange.Proto.Generator/**
80+ - Lagrange.Milky/**
81+ workflow_dispatch :
82+
83+ jobs :
84+ build :
85+ runs-on : ${{ matrix.os }}
86+ strategy :
87+ matrix :
88+ include :
89+ - os : windows-latest
90+ rid : win-x64
91+ binary-extension : ' .exe'
92+ - os : macos-latest
93+ rid : osx-arm64
94+ binary-extension : ' '
95+ - os : ubuntu-latest
96+ rid : linux-x64
97+ binary-extension : ' '
98+
3899 env :
39100 RUNTIME_IDENTIFIER : ${{ matrix.rid }}
40101
Original file line number Diff line number Diff line change 1+ name : Build Lagrange.Milky Docker
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ paths :
7+ - Lagrange.Codec/**
8+ - Lagrange.Core/**
9+ - Lagrange.Proto/**
10+ - Lagrange.Proto.Generator/**
11+ - Lagrange.Milky/**
12+ pull_request :
13+ branches : [ main ]
14+ paths :
15+ - Lagrange.Codec/**
16+ - Lagrange.Core/**
17+ - Lagrange.Proto/**
18+ - Lagrange.Proto.Generator/**
19+ - Lagrange.Milky/**
20+ workflow_dispatch :
21+
22+ jobs :
23+ build :
24+ runs-on : ubuntu-latest
25+
26+ steps :
27+ - uses : actions/checkout@v4
28+
29+ - name : Set up QEMU
30+ uses : docker/setup-qemu-action@v3
31+
32+ - name : Set up Docker Buildx
33+ uses : docker/setup-buildx-action@v3
34+
35+ - name : Login to Github Registry
36+ uses : docker/login-action@v3
37+ if : github.event_name != 'pull_request'
38+ with :
39+ registry : ghcr.io
40+ username : ${{ github.repository_owner }}
41+ password : ${{ secrets.GITHUB_TOKEN }}
42+
43+ - name : Extract metadata (tags, labels) for Docker
44+ id : meta
45+ uses : docker/metadata-action@v5
46+ with :
47+ images : |
48+ ghcr.io/${{ github.repository_owner }}/lagrange.milky
49+ tags : |
50+ type=edge
51+ type=sha,event=branch
52+ type=ref,event=tag
53+
54+ - name : Build and push
55+ uses : docker/build-push-action@v5
56+ with :
57+ context : .
58+ file : Lagrange.Milky/Resources/Dockerfile
59+ push : ${{ github.event_name != 'pull_request' }}
60+ tags : ${{ steps.meta.outputs.tags }}
61+ labels : ${{ steps.meta.outputs.labels }}
62+ platforms : linux/amd64
Original file line number Diff line number Diff line change 55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 <PublishAot >true</PublishAot >
8+ <InvariantGlobalization >true</InvariantGlobalization >
89 </PropertyGroup >
910 <PropertyGroup Condition =" '$(Configuration)' == 'Debug'" >
1011 <EmitCompilerGeneratedFiles >true</EmitCompilerGeneratedFiles >
Original file line number Diff line number Diff line change 1+ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
2+
3+ WORKDIR /root/build
4+ ARG TARGETARCH
5+
6+ RUN apk add --upgrade --no-cache \
7+ build-base \
8+ clang \
9+ zlib-dev
10+ COPY --link . /root/build
11+
12+ RUN dotnet publish Lagrange.Milky -p:DebugType="none" -c Release -a $TARGETARCH -o /root/out
13+
14+ # ===
15+
16+ FROM alpine
17+
18+ WORKDIR /app/data
19+
20+ COPY --link --from=tianon/gosu /gosu /usr/local/bin/
21+ COPY --link Lagrange.Milky/Resources/docker-entrypoint.sh /app/bin/docker-entrypoint.sh
22+
23+ COPY --link --from=build /root/out /app/bin
24+
25+ ENTRYPOINT ["/app/bin/docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ USER_ID=${UID:- 0}
4+
5+ if [ " $USER_ID " -ne 0 ]; then
6+ chown -R $USER_ID /app/data
7+ useradd --shell /bin/sh -u $USER_ID -o -c " " -m user
8+ usermod -a -G root user
9+ export HOME=/home/user
10+ exec /usr/sbin/gosu user /app/bin/Lagrange.Milky " $@ "
11+ else
12+ exec /app/bin/Lagrange.Milky " $@ "
13+ fi
You can’t perform that action at this time.
0 commit comments