Skip to content

Commit f4db8f7

Browse files
committed
Config proj
1 parent a98c7cd commit f4db8f7

File tree

2 files changed

+31
-47
lines changed

2 files changed

+31
-47
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,38 @@
1-
name: Auto-version and Publish
1+
name: Publish to NuGet
22

33
on:
44
push:
5-
branches:
6-
- main
5+
tags:
6+
- 'v*'
77

88
jobs:
9-
version-and-publish:
9+
build:
1010
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
1311

1412
steps:
15-
- uses: actions/checkout@v3
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Update Version and Create Tag
20-
run: |
21-
CSPROJ_FILE="$(find . -name "*.csproj" | head -n 1)"
22-
CURRENT_VERSION=$(grep -oP '(?<=<Version>)[^<]+' "$CSPROJ_FILE")
23-
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
24-
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$((VERSION_PARTS[2] + 1))"
25-
sed -i "s|<Version>$CURRENT_VERSION</Version>|<Version>$NEW_VERSION</Version>|" "$CSPROJ_FILE"
26-
27-
git config user.name "GitHub Actions"
28-
git config user.email "[email protected]"
29-
git add "$CSPROJ_FILE"
30-
git commit -m "bump version to $NEW_VERSION"
31-
git tag "v$NEW_VERSION"
32-
git push && git push --tags
33-
34-
- name: Setup .NET
35-
uses: actions/setup-dotnet@v3
36-
with:
37-
dotnet-version: '9.0.x'
38-
39-
- name: Build and Test
40-
run: |
41-
dotnet restore
42-
dotnet build --configuration Release
43-
dotnet test --no-restore
44-
45-
- name: Pack
46-
run: dotnet pack --configuration Release --no-build --output nupkgs
47-
48-
- name: Push to NuGet
49-
run: |
50-
cd nupkgs
51-
for f in *.nupkg
52-
do
53-
dotnet nuget push $f --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
54-
done
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: '9.0.x'
19+
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
23+
- name: Build
24+
run: dotnet build --configuration Release --no-restore
25+
26+
- name: Test
27+
run: dotnet test --no-restore --verbosity normal
28+
29+
- name: Pack
30+
run: dotnet pack --configuration Release --no-build --output nupkgs
31+
32+
- name: Push to NuGet
33+
run: |
34+
cd nupkgs
35+
for f in *.nupkg
36+
do
37+
dotnet nuget push $f --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
done

src/EtherScan.Dotnet.Client/EtherScan.Dotnet.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Package Info -->
99
<PackageId>etherscan.dotnet.client</PackageId>
10-
<Version>1.0.2</Version>
10+
<Version>1.0.4</Version>
1111
<Authors>Aybars</Authors>
1212
<Company>AybSoft</Company>
1313
<Product>Etherscan .NET Client</Product>

0 commit comments

Comments
 (0)