Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from chickensoft-games/feat/introspection-gener…
Browse files Browse the repository at this point in the history
…ator

refactor: update ci/cd and use introspection generator
  • Loading branch information
jolexxa authored Jun 8, 2024
2 parents 69e8d1d + d2d4cca commit e392f38
Show file tree
Hide file tree
Showing 24 changed files with 299 additions and 291 deletions.
75 changes: 0 additions & 75 deletions .github/workflows/auto_release.yaml

This file was deleted.

84 changes: 37 additions & 47 deletions .github/workflows/publish.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,75 +1,60 @@
name: '📦 Publish'
name: "📦 Publish"
on:
workflow_dispatch:
branches:
- main
inputs:
bump:
description: "Version Bump Method"
description: "version bump method: major, minor, patch"
type: choice
options:
- major
- minor
- patch
required: true
default: minor
workflow_call:
secrets:
NUGET_API_KEY:
description: "NuGet API Key"
required: true
inputs:
bump:
description: "Version Bump Method"
type: string
required: true
default: patch

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

- name: 🔎 Read Current Project Verson
uses: KageKirin/get-csproj-version@v1.0.0
- name: 🔎 Read Current Project Version
id: current-version
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
file: Chickensoft.PowerUps/Chickensoft.PowerUps.csproj
xpath: /Project/PropertyGroup/Version
fallback: "0.0.0-devbuild"

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

- name: ✨ Print Next Version
run: |
echo "Next Version: ${{ steps.next-version.outputs.version }}"
- name: 📝 Change Version
uses: vers-one/dotnet-project-version-updater@v1.3
# Write version to file so .NET will build correct version.
- name: 📝 Write Version to File
uses: jacobtomlinson/gha-find-replace@v3
with:
file: "Chickensoft.PowerUps/Chickensoft.PowerUps.csproj"
version: ${{ steps.next-version.outputs.version }}

- name: ✍️ Commit Changes
run: |
git config user.name "action@github.com"
git config user.email "GitHub Action"
git commit -a -m "chore(version): update version to ${{ steps.next-version.outputs.version }}"
git push
find: "0.0.0-devbuild"
replace: ${{ steps.next-version.outputs.version }}
regex: false
include: Chickensoft.PowerUps/Chickensoft.PowerUps.csproj

- name: 🖨 Copy Source to Source-Only package
run: |
Expand All @@ -85,12 +70,6 @@ jobs:
mkdir -p Chickensoft.PowerUps/src
cp -v -r Chickensoft.PowerUps.Tests/src/* Chickensoft.PowerUps/src/
- name: ✨ Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create --generate-notes "v${{ steps.next-version.outputs.version }}"

- name: 💽 Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
Expand All @@ -102,12 +81,23 @@ jobs:
run: |
dotnet build -c Release
- name: 📦 Publish
- name: 🔎 Get Package Path
id: package-path
run: |
# find the built nuget package
nuget_package=$(find ./nupkg -name "Chickensoft.PowerUps.*.nupkg")
package=$(find ./Chickensoft.PowerUps/nupkg -name "*.nupkg")
echo "package=$package" >> "$GITHUB_OUTPUT"
echo "📦 Found package: $package"
echo "📦 Publishing package: $nuget_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 }}"
# publish the nuget package
dotnet nuget push "$nuget_package" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
- 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
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"editor.formatOnSave": true,
"editor.formatOnType": false
},
// Required to keep the C# language server from getting confused about which
// solution to open.
"dotnet.defaultSolution": "Chickensoft.PowerUps.sln",
"csharp.semanticHighlighting.enabled": true,
"editor.semanticHighlighting.enabled": true,
// C# doc comment colorization gets lost with semantic highlighting, but we
Expand Down Expand Up @@ -163,4 +166,4 @@
}
},
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
}
}
14 changes: 7 additions & 7 deletions Chickensoft.PowerUps.Tests/Chickensoft.PowerUps.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Godot.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<LangVersion>10.0</LangVersion>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<RootNamespace>Chickensoft.PowerUps.Tests</RootNamespace>
<!-- Required for some nuget packages to work -->
Expand All @@ -15,12 +15,12 @@
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Chickensoft.GoDotTest" Version="1.1.7" />
<PackageReference Include="GodotTestDriver" Version="2.1.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="Chickensoft.SuperNodes" Version="1.6.1" PrivateAssets="all" OutputItemType="analyzer" />
<PackageReference Include="Chickensoft.SuperNodes.Types" Version="1.6.1" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.0.0-godot4.2.0-beta.5" />
<PackageReference Include="Chickensoft.GoDotTest" Version="1.5.3" />
<PackageReference Include="Chickensoft.GodotTestDriver" Version="3.0.0" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.2.4" />
<PackageReference Include="Chickensoft.Introspection" Version="1.2.0" />
<PackageReference Include="Chickensoft.Introspection.Generator" Version="1.2.0" PrivateAssets="all" OutputItemType="analyzer" />
</ItemGroup>
</Project>
Loading

0 comments on commit e392f38

Please sign in to comment.