Skip to content

Commit 0129fa3

Browse files
committed
优化readme,nuget,gitignore
1 parent 225daec commit 0129fa3

10 files changed

Lines changed: 484 additions & 23 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @StarryXYJ
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[Bug] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Describe the bug
10+
11+
A clear and concise description of what the bug is.
12+
13+
## To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
1. Go to '...'
17+
2. Click on '....'
18+
3. Scroll down to '....'
19+
4. See error
20+
21+
## Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
## Environment
26+
27+
- OS: [e.g. Windows 11]
28+
- .NET Version: [e.g. .NET 9.0]
29+
- Avalonia Version: [e.g. 11.2.7]
30+
- Package Version: [e.g. 1.0.0]
31+
32+
## Additional context
33+
34+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 📖 Documentation
4+
url: https://github.com/StarryXYJ/Avalonia.DynamicLocalization#readme
5+
about: Check the documentation before opening an issue
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[Feature] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Is your feature request related to a problem?
10+
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
## Describe the solution you'd like
14+
15+
A clear and concise description of what you want to happen.
16+
17+
## Describe alternatives you've considered
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional context
22+
23+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Description
2+
3+
<!-- Please include a summary of the change and which issue is fixed. -->
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
14+
## Checklist
15+
16+
- [ ] My code follows the style guidelines of this project
17+
- [ ] I have performed a self-review of my own code
18+
- [ ] I have commented my code, particularly in hard-to-understand areas
19+
- [ ] I have made corresponding changes to the documentation
20+
- [ ] My changes generate no new warnings
21+
- [ ] I have added tests that prove my fix is effective or that my feature works

.github/workflows/publish.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
env:
10+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
11+
DOTNET_NOLOGO: true
12+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
13+
14+
jobs:
15+
build-and-publish:
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Fetch all tags
25+
run: git fetch --tags
26+
27+
- name: Show current tag
28+
run: git describe --tags
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: |
34+
6.0.x
35+
7.0.x
36+
8.0.x
37+
9.0.x
38+
39+
- name: Cache NuGet packages
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ github.workspace }}/.nuget/packages
43+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
44+
restore-keys: |
45+
${{ runner.os }}-nuget-
46+
47+
- name: Restore dependencies
48+
run: dotnet restore
49+
50+
- name: Build
51+
run: dotnet build --configuration Release --no-restore -p:ContinuousIntegrationBuild=true
52+
53+
- name: Test
54+
run: dotnet test --configuration Release --no-build --verbosity normal
55+
56+
- name: Pack
57+
run: dotnet pack --configuration Release --no-build --output artifacts
58+
59+
- name: List packages
60+
run: Get-ChildItem artifacts -Filter *.nupkg
61+
62+
- name: Publish to NuGet
63+
if: startsWith(github.ref, 'refs/tags/v')
64+
run: |
65+
Get-ChildItem artifacts -Filter *.nupkg | ForEach-Object {
66+
dotnet nuget push $_.FullName --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
67+
}
68+
69+
- name: Upload artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: nuget-packages
73+
path: artifacts/*.nupkg
74+
retention-days: 30
75+
76+
- name: Create GitHub Release
77+
if: startsWith(github.ref, 'refs/tags/v')
78+
uses: softprops/action-gh-release@v2
79+
with:
80+
files: artifacts/*.nupkg
81+
generate_release_notes: true

0 commit comments

Comments
 (0)