Skip to content

Commit 2e4707e

Browse files
authored
Merge pull request #1 from datacute/develop
Converted EmbeddedResourcePropertyGenerator code
2 parents 112c2e4 + 1590409 commit 2e4707e

22 files changed

+1525
-18
lines changed

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
tags:
9+
- '*.*.*'
10+
pull_request:
11+
branches:
12+
- main
13+
- develop
14+
workflow_dispatch:
15+
16+
permissions:
17+
checks: write
18+
statuses: write
19+
contents: write
20+
21+
jobs:
22+
build:
23+
24+
env:
25+
BUILD_CONFIG: 'Release'
26+
SOLUTION: '*.sln'
27+
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: '9.0.x'
37+
38+
- name: Get tag for current commit
39+
id: get_tag
40+
# Check for tags when triggered by main branch push (with tag) or direct tag push
41+
# Can't use github.ref_name because it's "main" when pushing branch+tag together
42+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
43+
uses: olegtarasov/[email protected]
44+
45+
- name: Set Version Profile
46+
run: |
47+
if [[ "${{ steps.get_tag.outputs.tag }}" != "" ]]; then
48+
echo "VERSION_PROFILE=release" >> $GITHUB_ENV
49+
else
50+
echo "VERSION_PROFILE=ci" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Restore dependencies
54+
run: dotnet restore $SOLUTION
55+
56+
- name: Build
57+
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore -p:GeneratePackageOnBuild=false -p:VersionProfile=${{ env.VERSION_PROFILE }}
58+
59+
- name: Run tests
60+
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal -p:VersionProfile=${{ env.VERSION_PROFILE }}
61+
62+
- name: Pack NuGet packages
63+
run: |
64+
dotnet pack $SOLUTION --configuration $BUILD_CONFIG --no-build --output ./artifacts -p:VersionProfile=${{ env.VERSION_PROFILE }}
65+
echo "=== Packages created ==="
66+
ls -la ./artifacts/
67+
68+
- name: Extract release notes from CHANGELOG.md
69+
if: steps.get_tag.outputs.tag != ''
70+
id: extract_notes
71+
uses: mindsers/changelog-reader-action@v2
72+
with:
73+
version: ${{ steps.get_tag.outputs.tag }}
74+
path: ./CHANGELOG.md
75+
76+
- name: Create GitHub Release
77+
if: steps.get_tag.outputs.tag != ''
78+
uses: softprops/action-gh-release@v1
79+
with:
80+
tag_name: ${{ steps.get_tag.outputs.tag }}
81+
body: ${{ steps.extract_notes.outputs.changes }}
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '9.0.x'
20+
21+
- name: Restore, Build, and Pack
22+
run: |
23+
dotnet restore *.sln
24+
dotnet build *.sln --configuration Release --no-restore -p:ContinuousIntegrationBuild=true -p:GeneratePackageOnBuild=false -p:VersionProfile=release
25+
dotnet pack *.sln --configuration Release --no-build --output ./artifacts -p:ContinuousIntegrationBuild=true -p:VersionProfile=release
26+
27+
- name: Publish to NuGet
28+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)