Skip to content

Commit a649d8e

Browse files
committed
Rename job 'ui' to 'build_ui' in CI and update release workflow for improved clarity and consistency
1 parent b779e54 commit a649d8e

File tree

2 files changed

+49
-29
lines changed

2 files changed

+49
-29
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
working-directory: ${{ matrix.project }}
3636
run: dotnet test ./all.csproj /p:BuildTestsOnly=true --no-build
3737

38-
ui:
38+
build_ui:
3939
runs-on: ubuntu-latest
4040
timeout-minutes: 15
4141
steps:

.github/workflows/release.yml

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release
2+
run-name: Release 🚀 ${{ github.ref_name }}
23

34
on:
45
push:
@@ -8,20 +9,27 @@ on:
89
jobs:
910
release:
1011
runs-on: ubuntu-latest
11-
12+
strategy:
13+
matrix:
14+
project: ['./src/IdentityServer', './src/Server']
1215
steps:
1316
- name: Checkout code
14-
uses: actions/checkout@v4
15-
- name: Use .NET SDK from global.json
16-
uses: actions/setup-dotnet@v4
17+
uses: actions/checkout@v6
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v5
21+
1722
- name: Setup Node.js
18-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
1924
with:
2025
check-latest: true
2126
node-version-file: 'src/UI/package.json'
2227
cache: 'yarn'
2328
cache-dependency-path: 'src/UI/yarn.lock'
29+
2430
- name: Build UI
31+
shell: bash
32+
if: matrix.project == './src/Server'
2533
run: |
2634
export NODE_OPTIONS=--openssl-legacy-provider
2735
yarn config set strict-ssl false
@@ -30,28 +38,40 @@ jobs:
3038
rm -rf src/Server/src/AspNet/UI
3139
mkdir src/Server/src/AspNet/UI/
3240
cp -rf src/UI/dist/* src/Server/src/AspNet/UI
41+
42+
- name: Build projects
3343
shell: bash
34-
- name: Build, Test and Push
35-
uses: swisslife-oss/actions/release-packages@main
36-
with:
37-
tag: ${{ github.ref_name }}
38-
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
39-
enable_push: 'yes'
44+
working-directory: ${{ matrix.project }}
45+
run: dotnet build ./all.csproj -c Release
4046

41-
sonar:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- name: Checkout code
45-
uses: actions/checkout@v4
46-
- name: Setup .NET
47-
uses: actions/setup-dotnet@v4
48-
- name: Restore tools
49-
run: dotnet tool restore
50-
- name: Build, Test and Sonar
51-
uses: swisslife-oss/actions/release-sonar@main
52-
with:
53-
tag: ${{ github.ref_name }}
54-
sonar_token: ${{ secrets.SONAR_TOKEN }}
55-
sonar_project_key: 'SwissLife-OSS_IdOps'
56-
sonar_project_name: "IdOps"
57-
sonar_exclusions: ${{ vars.SONAR_EXCLUSIONS }}
47+
- name: Extract version
48+
id: extract_version
49+
shell: bash
50+
run: |
51+
PACKAGE_VERSION="${{ github.ref_name }}"
52+
ASSEMBLY_VERSION="$(echo ${{ github.ref_name }} | grep -o '^[0-9]*\.[0-9]*\.[0-9]*').0"
53+
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
54+
echo "assembly_version=$ASSEMBLY_VERSION" >> $GITHUB_OUTPUT
55+
echo "Package Version: $PACKAGE_VERSION"
56+
echo "Assembly Version: $ASSEMBLY_VERSION"
57+
58+
- name: Pack
59+
shell: bash
60+
working-directory: ${{ matrix.project }}
61+
run: |
62+
dotnet pack ./all.csproj \
63+
-c Release \
64+
-o ./out \
65+
--no-build \
66+
--include-symbols \
67+
--include-source \
68+
--verbosity Minimal \
69+
/p:Version=${{ steps.extract_version.outputs.package_version }} \
70+
/p:AssemblyVersion=${{ steps.extract_version.outputs.assembly_version }} \
71+
/p:FileVersion=${{ steps.extract_version.outputs.assembly_version }}
72+
73+
- name: Push
74+
shell: bash
75+
working-directory: ${{ matrix.project }}
76+
run: |
77+
find . -name '*.nupkg' | grep -v '.sources.nupkg' | parallel --jobs 0 'dotnet nuget push {} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json'

0 commit comments

Comments
 (0)