Skip to content

Commit 821b180

Browse files
committed
feat: Add GitHub Packages support for NuGet distribution
- Add RepositoryUrl to project file for GitHub integration - Configure workflows to publish to both NuGet.org and GitHub Packages - Add packages:write permission to workflows - Update README with GitHub Packages installation instructions - Add --skip-duplicate flag to prevent duplicate package errors Now packages will be available at: - NuGet.org: https://www.nuget.org/packages/DotnetDevKR.TailwindCSS/ - GitHub Packages: https://github.com/dotnetdev-kr/DotnetDevKR.TailwindCSS/packages
1 parent c99f860 commit 821b180

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

.github/workflows/nuget-release.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
publish:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
1215
steps:
1316
- name: Checkout repository
1417
uses: actions/checkout@v4
@@ -55,10 +58,20 @@ jobs:
5558
--output ./artifacts \
5659
/p:Version=${{ env.VERSION }}
5760
58-
- name: Publish to NuGet
61+
- name: Publish to NuGet.org
5962
run: |
6063
dotnet nuget push ./artifacts/*.nupkg \
6164
--source https://api.nuget.org/v3/index.json \
62-
--api-key ${{ secrets.NUGET_API_KEY }}
65+
--api-key ${{ secrets.NUGET_API_KEY }} \
66+
--skip-duplicate
6367
env:
6468
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
69+
70+
- name: Publish to GitHub Packages
71+
run: |
72+
dotnet nuget push ./artifacts/*.nupkg \
73+
--source https://nuget.pkg.github.com/dotnetdev-kr/index.json \
74+
--api-key ${{ secrets.GITHUB_TOKEN }} \
75+
--skip-duplicate
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tailwindcss-auto-update.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14+
packages: write
1415

1516
steps:
1617
- name: Checkout repository
@@ -121,7 +122,7 @@ jobs:
121122
--output ./artifacts \
122123
/p:Version=${{ env.NEW_VERSION }}
123124
124-
- name: Publish to NuGet
125+
- name: Publish to NuGet.org
125126
if: env.UPDATE_NEEDED == 'true'
126127
run: |
127128
dotnet nuget push ./artifacts/*.nupkg \
@@ -131,6 +132,16 @@ jobs:
131132
env:
132133
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
133134

135+
- name: Publish to GitHub Packages
136+
if: env.UPDATE_NEEDED == 'true'
137+
run: |
138+
dotnet nuget push ./artifacts/*.nupkg \
139+
--source https://nuget.pkg.github.com/dotnetdev-kr/index.json \
140+
--api-key ${{ secrets.GITHUB_TOKEN }} \
141+
--skip-duplicate
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
134145
- name: Create GitHub Release
135146
if: env.UPDATE_NEEDED == 'true'
136147
uses: softprops/action-gh-release@v1

DotnetDevKR.TailwindCSS/DotnetDevKR.TailwindCSS.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
88
<PackageReadmeFile>README.md</PackageReadmeFile>
99
<RepositoryType>git</RepositoryType>
10+
<RepositoryUrl>https://github.com/dotnetdev-kr/DotnetDevKR.TailwindCSS</RepositoryUrl>
1011
<Version>0.0.1+v4.1.11</Version>
1112
<Authors>DotnetDevKR</Authors>
1213
<PackageTags>TailwindCSS</PackageTags>

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,34 @@ A .NET MSBuild integration package for TailwindCSS that automatically compiles y
1313

1414
## Installation
1515

16+
### From NuGet.org
17+
1618
Install the NuGet package in your .NET project:
1719

1820
```bash
1921
dotnet add package DotnetDevKR.TailwindCSS
2022
```
2123

24+
### From GitHub Packages
25+
26+
You can also install the package from GitHub Packages:
27+
28+
1. Add GitHub Packages as a NuGet source (one time setup):
29+
```bash
30+
dotnet nuget add source https://nuget.pkg.github.com/dotnetdev-kr/index.json \
31+
--name github \
32+
--username YOUR_GITHUB_USERNAME \
33+
--password YOUR_GITHUB_PAT \
34+
--store-password-in-clear-text
35+
```
36+
37+
2. Install the package:
38+
```bash
39+
dotnet add package DotnetDevKR.TailwindCSS
40+
```
41+
42+
> **Note:** You need a GitHub Personal Access Token (PAT) with `read:packages` scope to install from GitHub Packages.
43+
2244
## Quick Start
2345

2446
> [!Warning]

0 commit comments

Comments
 (0)