-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (141 loc) · 5.29 KB
/
main.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Mimisbrunnr Build
on:
push:
branches: [ main ]
tags:
- v*
pull_request:
branches: [ main ]
jobs:
publish-import-cli-binary:
if: contains(github.ref, 'tags/v') # works only version tagged
runs-on: ubuntu-latest
strategy:
matrix:
rid: [ win-x86, linux-x64, linux-arm, linux-arm64, osx-x64 ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
- name: Build
run: |
dotnet publish ./src/DataImport/Mimisbrunnr.DataImport.Cli/Mimisbrunnr.DataImport.Cli.csproj -c Release --self-contained -r ${{ matrix.rid }} -p:PublishSingleFile=true -o ./bin/mimisbrunnr-import-cli-${{ matrix.rid }}
zip -r ${{ matrix.rid }} ./bin/mimisbrunnr-import-cli-${{ matrix.rid }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ matrix.rid }}.zip
asset_name: mimisbrunnr-import-cli-${{ matrix.rid }}.zip
tag: ${{ github.ref }}
overwrite: false
publish-persistent-migration-cli-binary:
if: contains(github.ref, 'tags/v') # works only version tagged
runs-on: ubuntu-latest
strategy:
matrix:
rid: [ win-x86, linux-x64, linux-arm, linux-arm64, osx-x64 ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
- name: Build
run: |
dotnet publish ./src/Migration/Mimisbrunnr.Migration.Persistent.Cli/Mimisbrunnr.Migration.Persistent.Cli.csproj -c Release --self-contained -r ${{ matrix.rid }} -p:PublishSingleFile=true -o ./bin/mimisbrunnr-persistent-migration-cli-${{ matrix.rid }}
zip -r ${{ matrix.rid }} ./bin/mimisbrunnr-persistent-migration-cli-${{ matrix.rid }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ matrix.rid }}.zip
asset_name: mimisbrunnr-persistent-migration-cli-${{ matrix.rid }}.zip
tag: ${{ github.ref }}
overwrite: false
publish-webapp-binary:
if: contains(github.ref, 'tags/v') # works only version tagged
runs-on: ubuntu-latest
strategy:
matrix:
rid: [ win-x86, linux-x64, linux-arm, linux-arm64, osx-x64 ]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
NUGET_XMLDOC_MODE: skip
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
- name: Setup NodeJs
uses: actions/setup-node@v1
with:
node-version: '18'
- name: Build
run: |
dotnet publish ./src/Mimisbrunnr.Web.Host/Mimisbrunnr.Web.Host.csproj -c Release --self-contained -r ${{ matrix.rid }} -p:PublishSingleFile=true -o ./bin/mimisbrunnr-wiki-${{ matrix.rid }}
zip -r ${{ matrix.rid }} ./bin/mimisbrunnr-wiki-${{ matrix.rid }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ matrix.rid }}.zip
asset_name: mimisbrunnr-wiki-${{ matrix.rid }}.zip
tag: ${{ github.ref }}
overwrite: false
publish-webapp-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build And Push Mimisbrunnr
uses: docker/build-push-action@v1.1.0
with:
repository: eluki/mimisbrunnr-wiki
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
target: app
tag_with_ref: true
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
publish-client-library-nuget:
if: contains(github.ref, 'tags/v') || github.ref == 'refs/heads/main'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: action-minver
uses: thefringeninja/action-minver@2.0.0-preview1
id: version
with:
# Optional. Specifies the default pre-release phase.
default-pre-release-phase: unstalable
# Optional. Specifies the prefix of the tags
tag-prefix: v
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
- name: Pack package
run: dotnet pack ./src/Integration/Mimisbrunnr.Integration.Client/Mimisbrunnr.Integration.Client.csproj -c Release -p:PackageVersion=${{ steps.version.outputs.version }}
- name: Publish
run: Get-ChildItem -Path ./src/**/*.nupkg -Recurse -Force | % { dotnet nuget push $_.ToString() --skip-duplicate -s https://nuget.org/ -k ${{secrets.NUGET_PUBLISH_KEY}} }