Skip to content

Commit

Permalink
chore: update project
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa committed May 12, 2024
1 parent a46d4a2 commit 36ca8f4
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 3 deletions.
84 changes: 84 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: '📦 Release'
on:
# Releases are created when manually dispatched by the developer via the
# GitHub user interface.
workflow_dispatch:
inputs:
bump:
type: string
description: "major, minor, or patch"
required: true
default: "patch"

jobs:
release:
name: '📦 Release'
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
steps:
- name: 🧾 Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_BASIC }}
lfs: true
submodules: 'recursive'
fetch-depth: 0 # So we can get all tags.

- name: 🔎 Read Current Project Version
id: current-version
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: "0.0.0-devbuild"

- name: 🖨 Print Current Version
run: |
echo "Current Version: ${{ steps.current-version.outputs.tag }}"
- name: 🧮 Compute Next Version
uses: chickensoft-games/next-godot-csproj-version@v1
id: next-version
with:
project-version: ${{ steps.current-version.outputs.tag }}
godot-version: global.json
bump: ${{ inputs.bump }}

- uses: actions/setup-dotnet@v4
name: 💽 Setup .NET SDK
with:
# Use the .NET SDK from global.json in the root of the repository.
global-json-file: global.json

# Write version to file so .NET will build correct version.
- name: 📝 Write Version to File
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "0.0.0-devbuild"
replace: ${{ steps.next-version.outputs.version }}
regex: false
include: Chickensoft.EditorConfig.csproj

- name: 📦 Build
run: dotnet build -c Release

- name: 🔎 Get Package Path
id: package-path
run: |
package=$(find ./nupkg -name "*.nupkg")
echo "package=$package" >> "$GITHUB_OUTPUT"
echo "📦 Found package: $package"
- name: ✨ Create Release
env:
GITHUB_TOKEN: ${{ secrets.GH_BASIC }}
run: |
version="${{ steps.next-version.outputs.version }}"
gh release create --title "v$version" --generate-notes "$version" \
"${{ steps.package-path.outputs.package }}"
- name: 🛜 Publish to Nuget
run: |
dotnet nuget push "${{ steps.package-path.outputs.package }}" \
--api-key "${{ secrets.NUGET_API_KEY }}" \
--source "https://api.nuget.org/v3/index.json" --skip-duplicate
2 changes: 1 addition & 1 deletion Chickensoft.EditorConfig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageAuthor>Chickensoft</PackageAuthor>

<Title>Chickensoft EditorConfig</Title>
<Version>1.0.1</Version>
<Version>0.0.0-devbuild</Version>
<Description>Chickensoft's EditorConfig for C#.</Description>
<Copyright>© 2023 Chickensoft</Copyright>
<Company>Chickensoft</Company>
Expand Down
11 changes: 9 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"words": [
"chickenconfig",
"Chickensoft",
"devbuild",
"Haximus",
"jacobtomlinson",
"msbuild",
"netstandard",
"NOLOGO",
"nupkg",
"roslynator"
"OPTOUT",
"roslynator",
"Wyri"
]
}
}
9 changes: 9 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"sdk": {
"version": "8.0.204",
"rollForward": "latestMinor"
},
"msbuild-sdks": {
"Godot.NET.Sdk": "4.2.2"
}
}
12 changes: 12 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -456,3 +456,15 @@ dotnet_diagnostic.RCS1161.severity = none
dotnet_diagnostic.RCS1165.severity = none
# Allow keyword-based names so that parameter names like `@event` can be used.
dotnet_diagnostic.CA1716.severity = none
# Let me put comments where I like
dotnet_diagnostic.RCS1181.severity = none
# Allow me to use the word Collection if I want.
dotnet_diagnostic.CA1711.severity = none
# No primary constructors — not supported well by tooling.
dotnet_diagnostic.IDE0290.severity = none
# Let me write dumb if statements for readability.
dotnet_diagnostic.IDE0046.severity = none
# Don't make me use expression bodies for methods
dotnet_diagnostic.IDE0022.severity = none
# Don't make me populate a switch expression redundantly
dotnet_diagnostic.IDE0072.severity = none

0 comments on commit 36ca8f4

Please sign in to comment.