-
Notifications
You must be signed in to change notification settings - Fork 1k
77 lines (66 loc) · 2.27 KB
/
docker.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
name: Publish (docker-image)
on:
release:
types: [published]
env:
DOTNET_VERSION: 8.0.x
DIST_DIR: ./dist
jobs:
neo-cli-build:
runs-on: ubuntu-latest
steps:
- name: Set Application Version (Environment Variable)
run: |
APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2)
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build (neo-cli)
run: |
dotnet publish ./src/Neo.CLI \
--framework net8.0 \
--configuration Release \
--runtime linux-x64 \
--self-contained true \
--output ${{ env.DIST_DIR }} \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }} \
-p:RuntimeIdentifier=linux-x64 \
-p:SelfContained=true \
-p:IncludeNativeLibrariesForSelfExtract=false \
-p:PublishTrimmed=false \
-p:PublishSingleFile=true \
-p:PublishReadyToRun=true \
-p:EnableCompressionInSingleFile=true \
-p:DebugType=embedded \
-p:ServerGarbageCollection=true
- name: Build (LevelDbStore)
run: |
dotnet build ./src/Plugins/LevelDBStore \
--framework net8.0 \
--configuration Release \
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}
- name: Remove (junk)
run: |
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/Neo*
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.pdb
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.xml
rm -v ${{ env.DIST_DIR }}/*.xml
- name: Docker Login
run: |
docker login ghcr.io \
--username ${{ github.repository_owner }} \
--password ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build
run: |
docker build . \
--file ./.neo/docker/neo-cli/Dockerfile \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:latest \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:${{ env.APP_VERSION }} \
--push