Skip to content

Commit f1c97a1

Browse files
author
fadhly.permata
committed
Add GitHub CI/CD workflow for automated NuGet publishing
Implements GitHub Actions workflow to automatically publish the .NET package to NuGet and create GitHub releases when new version tags are pushed - Sets up build, test, and package steps using .NET 8 - Configures NuGet package metadata in the project file - Adds GitHub Release creation with auto-generated changelog - Includes VS Code editor settings for better development experience
1 parent b9dde02 commit f1c97a1

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish JQL.Net to NuGet and GitHub Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions: # Diperlukan untuk membuat GitHub Release
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Mengambil seluruh histori untuk generate changelog
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: '8.0.x'
23+
24+
- name: Restore
25+
run: dotnet restore
26+
27+
- name: Build
28+
run: dotnet build --configuration Release --no-restore
29+
30+
- name: Test
31+
run: dotnet test --configuration Release --no-build --verbosity normal
32+
33+
- name: Pack
34+
# Membuat paket NuGet (.nupkg)
35+
run: dotnet pack --configuration Release --no-build -o dist
36+
37+
- name: Push to NuGet
38+
run: dotnet nuget push dist/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
39+
40+
- name: Create GitHub Release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
files: dist/*.nupkg # Melampirkan file paket ke halaman release GitHub
44+
generate_release_notes: true # Otomatis membuat daftar commit sebagai changelog
45+
draft: false
46+
prerelease: false

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.occurrencesHighlight": "off",
3+
"editor.selectionHighlight": false
4+
}

JQL.Net.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@
1313
<Nullable>enable</Nullable>
1414
<NoWarn>$(NoWarn);S1192</NoWarn>
1515
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<PackageId>JQL.Net</PackageId>
19+
<Version>1.0.0</Version> <Authors>Fadhly Permata</Authors>
20+
<Description>Lightweight SQL-inspired engine to query JSON in .NET</Description>
21+
<PackageReadmeFile>README.md</PackageReadmeFile>
22+
<RepositoryUrl>https://github.com/fadhly-permata/JQL.Net</RepositoryUrl>
23+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
24+
</PropertyGroup>
25+
1626
<ItemGroup>
1727
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
1828
</ItemGroup>
29+
1930
<ItemGroup>
2031
<None Include="README.md" Pack="true" PackagePath="\" />
2132
<None Include="LICENSE" Pack="true" PackagePath="\" />

0 commit comments

Comments
 (0)