-
Notifications
You must be signed in to change notification settings - Fork 22
79 lines (67 loc) · 2.24 KB
/
release.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
name: Publish
permissions:
contents: write
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
- name: Build and publish
run: |
architectures=(win-x64 osx-x64 linux-x64 win-arm64 osx-arm64 linux-arm64)
for arch in "${architectures[@]}"; do
dotnet publish src -c Release -r "$arch" /p:PublishSingleFile=true
cd src/bin/Release/net8.0/"$arch"/publish
zip -r ../../../../../../i3dm.export-"$arch".zip *
cd ../../../../../..
done
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
Release.txt
i3dm.export-win-x64.zip
i3dm.export-win-arm64.zip
i3dm.export-osx-x64.zip
i3dm.export-osx-arm64.zip
i3dm.export-linux-x64.zip
i3dm.export-linux-arm64.zip
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true
- name: Pack
working-directory: src
run: |
dotnet build i3dm.export.csproj --configuration Release
dotnet pack i3dm.export.csproj --configuration Release -p:PackAsTool=true --output ./nupkg
- name: Publish to NuGet
working-directory: src
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish
run: |
docker build ./src --file Dockerfile --tag geodan/i3dm.export:latest
docker push geodan/i3dm.export:latest
docker tag geodan/i3dm.export:latest geodan/i3dm.export:${{ steps.tag.outputs.tag }}
docker push geodan/i3dm.export:${{ steps.tag.outputs.tag }}