Repository navigation
64 lines (64 loc) · 2.66 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (64 loc) · 2.66 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
name: Release
on:
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
name: Publish ${{ matrix.runtime }}
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
runtime: [linux-x64, linux-arm64, win-x64, win-arm64, osx-x64, osx-arm64]
steps:
- name: Download source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
global-json-file: global.json
- name: Publish server and CLI
env:
RUNTIME: ${{ matrix.runtime }}
run: |
dotnet publish src/KeyLoad/KeyLoad.csproj --configuration Release --runtime "$RUNTIME" --self-contained true -warnaserror --output artifacts/publish/server
dotnet publish src/KeyLoad.Cli/KeyLoad.Cli.csproj --configuration Release --runtime "$RUNTIME" --self-contained true -warnaserror --output artifacts/publish/cli
tar -czf "artifacts/keyload-$RUNTIME.tar.gz" -C artifacts/publish server cli
- name: Save applications
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: keyload-${{ matrix.runtime }}
path: artifacts/keyload-${{ matrix.runtime }}.tar.gz
if-no-files-found: error
docker:
name: Build Docker image (${{ matrix.image }})
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- image: server
project: src/KeyLoad/KeyLoad.csproj
- image: benchmarks
project: benchmarks/KeyLoad.ComparisonHost/KeyLoad.ComparisonHost.csproj
steps:
- name: Download source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
global-json-file: global.json
- name: Build Docker image
env:
PROJECT: ${{ matrix.project }}
IMAGE: ${{ matrix.image }}
run: dotnet publish "$PROJECT" /t:PublishContainer --configuration Release --runtime linux-x64 -warnaserror -p:ContainerRepository="keyload/$IMAGE" -p:ContainerImageTag="$GITHUB_SHA" -p:ContainerArchiveOutputPath="$GITHUB_WORKSPACE/keyload-$IMAGE.tar"
- name: Save Docker image
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: keyload-docker-${{ matrix.image }}
path: keyload-${{ matrix.image }}.tar
if-no-files-found: error