-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (151 loc) · 5.37 KB
/
release.yaml
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Release
run-name: Release
on:
push:
branches:
- main
jobs:
debug:
name: Debug
runs-on: ubuntu-latest
steps:
- run: |
echo "============="
echo "=== Debug ==="
echo "============="
echo "github ref: " ${{ vars.GITHUB_REF }}
echo "dotnet version: " ${{ vars.DOTNET_VERSION }}
echo "event name: " ${{ github.event_name }}
commons:
name: EG.Commons
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v3
- name: Setting up Dotnet with ${{ vars.DOTNET_VERSION }} version
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ vars.DOTNET_VERSION }}
- name: Restore
run: |
dotnet restore src/EG.Common/EG.Common.sln
- name: Build
run: |
dotnet build --configuration Release src/EG.Common/EG.Common.sln
- name: Test
run: |
dotnet test --no-restore --verbosity normal src/EG.Common/EG.Common.sln
backend:
name: EG.Backend
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v3
- name: Setting up Dotnet with ${{ vars.DOTNET_VERSION }} version
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ vars.DOTNET_VERSION }}
- name: EG Nuget repo
run: |
dotnet nuget add source --username Andras-Csanyi --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/EncyclopediaGalactica/index.json"
- name: Restore
run: |
dotnet restore src/EG.Backend/EG.Backend.sln
- name: Build
run: |
dotnet build --configuration Release src/EG.Backend/EG.Backend.sln
- name: Test
run: |
dotnet test --no-restore --verbosity normal src/EG.Backend/EG.Backend.sln
frontend:
name: EG.Frontend
runs-on: ubuntu-latest
needs: debug
steps:
- uses: actions/checkout@v3
- name: Setting up Dotnet with ${{ vars.DOTNET_VERSION }} version
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ vars.DOTNET_VERSION }}
- name: EG Nuget repo
run: |
dotnet nuget add source --username Andras-Csanyi --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/EncyclopediaGalactica/index.json"
- name: Restore
run: |
dotnet restore src/EG.FrontEnd/EG.FrontEnd.sln
- name: Build
run: |
dotnet build --configuration Release src/EG.FrontEnd/EG.FrontEnd.sln
- name: Test
run: |
dotnet test --no-restore --verbosity normal src/EG.FrontEnd/EG.FrontEnd.sln
semantic_versioning:
name: Semantic Versioning
runs-on: ubuntu-latest
needs:
- debug
- backend
- frontend
- commons
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: write
issues: write
pull-requests: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install Semantic Dependencies
run: |
npm install npm
npm install semantic-release
npm install @semantic-release/changelog
npm install @semantic-release/exec
npm install @semantic-release/git
npm install @semantic-release/github
- name: Setup Python
uses: actions/setup-python@v4
with:
cache: 'pip'
- name: Debug Info Python tools
run: |
pip3 --version
pip3 install --user bump2version
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_SEMANTIC_RELEASE }}
run: |
npx semantic-release
- name: Variables
run: |
APPVERSION=$(cat version.txt)
echo "EGVERSION=$APPVERSION" >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Setting up Dotnet with ${{ vars.DOTNET_VERSION }} version
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ vars.DOTNET_VERSION }}
- name: Restore
run: |
dotnet restore src/EG.Common/EG.Common.sln
- name: Build
run: |
dotnet build --configuration Release --no-restore src/EG.Common/EG.Common.sln
- name: Test
run: |
dotnet test --no-restore --verbosity normal src/EG.Common/EG.Common.sln
- name: Pack
run: |
dotnet pack --no-restore --verbosity normal --include-symbols --include-source src/EG.Common/BusinessLogic.Contracts/BusinessLogic.Contracts.csproj
- name: Publish
run: |
dotnet nuget add source --username Andras-Csanyi --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/EncyclopediaGalactica/index.json"
dotnet nuget push "/home/runner/work/EncyclopediaGalactica/EncyclopediaGalactica/src/EG.Common/BusinessLogic.Contracts/bin/Release/EncyclopediaGalactica.BusinessLogic.Contracts.${{ env.EGVERSION }}.nupkg" --source "github" --api-key ${{ secrets.TOKEN_PUBLISH_NUGET }} --skip-duplicate