forked from tatwd/prism-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,63 +4,36 @@ on: [push, pull_request] | |
|
||
jobs: | ||
build: | ||
|
||
env: | ||
BUILD_CONFIG: 'Release' | ||
SOLUTION: 'PrismSharp.sln' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
|
||
# - name: Get Build Version | ||
# run: | | ||
# Import-Module .\scripts\GetBuildVersion.psm1 | ||
# Write-Host $Env:GITHUB_REF | ||
# $version = GetBuildVersion -VersionString $Env:GITHUB_REF | ||
# echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
# shell: pwsh | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
# - name: Restore dependencies | ||
# run: nuget restore $SOLUTION | ||
submodules: 'recursive' | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
- name: Setup .NET 9 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 6.x | ||
dotnet-version: 9.x.x | ||
|
||
- name: Restore dependencies by dotnet sdk | ||
run: dotnet restore $SOLUTION | ||
|
||
- name: Build | ||
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore | ||
|
||
- name: Run tests | ||
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal | ||
|
||
- name: Pack | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: >- | ||
dotnet build PrismSharp.RegExCompiler/PrismSharp.RegExCompiler.csproj --configuration Release; | ||
dotnet build PrismSharp.SourceGenerator/PrismSharp.SourceGenerator.csproj --configuration Release; | ||
dotnet build PrismSharp.Core/PrismSharp.Core.csproj --configuration Release; | ||
dotnet pack PrismSharp.Core/PrismSharp.Core.csproj --configuration Release -o "./packages"; | ||
shell: pwsh | ||
|
||
|
||
- name: Push to NuGet | ||
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org | ||
shell: pwsh | ||
|
||
- name: Push to GPR | ||
run: | | ||
dotnet pack --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal | ||
for f in ./packages/*.nupkg | ||
do | ||
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/ | ||
done | ||
shell: bash | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
**/*.nupkg | ||
# TODO: create changelog.md | ||
# body_path: changelog.md | ||
|
||
- name: Publish to nuget.org | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<id>BUTR.PrismSharp.Core</id> | ||
<version>$version$</version> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<license type="expression">MIT</license> | ||
<description>A porting of PrismJS to C# or .NET. Fork for BUTR use.</description> | ||
</metadata> | ||
<files> | ||
<file src="bin\$configuration$\netstandard2.0\PrismSharp.Core.dll" target="lib\netstandard2.0\PrismSharp.Core.dll" /> | ||
<file src="bin\$configuration$\netstandard2.0\PrismSharp.Core.pdb" target="lib\netstandard2.0\PrismSharp.Core.pdb" /> | ||
<file src="bin\$configuration$\netstandard2.0\PrismSharp.RegEx.dll" target="lib\netstandard2.0\PrismSharp.RegEx.dll" /> | ||
|
||
<file src="bin\$configuration$\net45\PrismSharp.Core.dll" target="lib\net45\PrismSharp.Core.dll" /> | ||
<file src="bin\$configuration$\net45\PrismSharp.Core.pdb" target="lib\net45\PrismSharp.Core.pdb" /> | ||
<file src="bin\$configuration$\net45\PrismSharp.RegEx.dll" target="lib\net45\PrismSharp.RegEx.dll" /> | ||
|
||
<file src="bin\$configuration$\net8.0\PrismSharp.Core.dll" target="lib\net8.0\PrismSharp.Core.dll" /> | ||
<file src="bin\$configuration$\net8.0\PrismSharp.Core.pdb" target="lib\net8.0\PrismSharp.Core.pdb" /> | ||
<file src="bin\$configuration$\net8.0\PrismSharp.RegEx.dll" target="lib\net8.0\PrismSharp.RegEx.dll" /> | ||
<file src="bin\$configuration$\net8.0\PrismSharp.RegEx.pdb" target="lib\net8.0\PrismSharp.RegEx.pdb" /> | ||
|
||
<file src="bin\$configuration$\net9.0\PrismSharp.Core.dll" target="lib\net9.0\PrismSharp.Core.dll" /> | ||
<file src="bin\$configuration$\net9.0\PrismSharp.Core.pdb" target="lib\net9.0\PrismSharp.Core.pdb" /> | ||
<file src="bin\$configuration$\net9.0\PrismSharp.RegEx.dll" target="lib\net9.0\PrismSharp.RegEx.dll" /> | ||
<file src="bin\$configuration$\net9.0\PrismSharp.RegEx.pdb" target="lib\net9.0\PrismSharp.RegEx.pdb" /> | ||
|
||
<file src="README.md" target="README.md" /> | ||
</files> | ||
</package> |