2022-04-20 12:16:06 +01:00
|
|
|
name: Tagged Pre-Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v[0-9]+.[0-9]+.[0-9]+-*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
prerelease:
|
|
|
|
name: "Tagged Pre-Release"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup .NET
|
2023-03-28 15:02:09 +01:00
|
|
|
uses: actions/setup-dotnet@v3
|
2022-04-20 12:16:06 +01:00
|
|
|
with:
|
2022-11-29 15:55:26 +00:00
|
|
|
dotnet-version: 7.0.x
|
2022-04-20 12:16:06 +01:00
|
|
|
|
|
|
|
- name: Add GitHub NuGet source
|
|
|
|
run: dotnet nuget add source --username oliverbooth --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/oliverbooth/index.json"
|
|
|
|
|
|
|
|
- name: Restore dependencies
|
|
|
|
run: dotnet restore
|
|
|
|
|
2022-05-13 09:55:06 +01:00
|
|
|
- name: Build
|
2023-04-02 16:46:34 +01:00
|
|
|
run: dotnet build --configuration Release --no-restore
|
2022-04-20 12:16:06 +01:00
|
|
|
|
|
|
|
- name: Build NuGet package
|
|
|
|
run: |
|
|
|
|
mkdir build
|
2023-04-02 16:46:34 +01:00
|
|
|
dotnet pack X10D --configuration Release --no-build -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
|
|
|
|
dotnet pack X10D.DSharpPlus --configuration Release --no-build -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
|
|
|
|
dotnet pack X10D.Hosting --configuration Release --no-build -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
|
|
|
|
dotnet pack X10D.Unity --configuration Release --no-build -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
|
2022-04-20 12:16:06 +01:00
|
|
|
|
|
|
|
- name: Push NuGet Package to GitHub
|
|
|
|
run: dotnet nuget push "build/*" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
|
|
|
|
|
|
|
|
- name: Push NuGet Package to nuget.org
|
|
|
|
run: dotnet nuget push "build/*" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
|
|
|
|
|
2023-04-02 15:44:10 +01:00
|
|
|
- name: Upload Build Artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: build/
|
|
|
|
|
2022-04-20 12:16:06 +01:00
|
|
|
- name: Create Release
|
|
|
|
uses: "marvinpinto/action-automatic-releases@latest"
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
prerelease: true
|
2023-03-29 15:00:00 +01:00
|
|
|
|
|
|
|
- name: Checkout upm branch
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: upm
|
|
|
|
path: upm
|
|
|
|
|
2023-03-29 16:03:48 +01:00
|
|
|
- name: Build package.json
|
|
|
|
run: |
|
|
|
|
dotnet run --project ./X10D.UpmPackageGenerator/X10D.UpmPackageGenerator.csproj "./X10D/bin/Release/netstandard2.1/X10D.dll"
|
|
|
|
cp package.json upm/package.json
|
|
|
|
|
2023-03-29 15:00:00 +01:00
|
|
|
- name: Commit update
|
|
|
|
run: |
|
|
|
|
cd upm
|
|
|
|
cp ../X10D/bin/Release/netstandard2.1/X10D.dll ./X10D.dll
|
|
|
|
cp ../X10D/bin/Release/netstandard2.1/X10D.xml ./X10D.xml
|
|
|
|
cp ../X10D.Unity/bin/Release/netstandard2.1/X10D.Unity.dll ./X10D.Unity.dll
|
|
|
|
cp ../X10D.Unity/bin/Release/netstandard2.1/X10D.Unity.xml ./X10D.Unity.xml
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github-actions@github.com
|
|
|
|
git add X10D.dll
|
|
|
|
git add X10D.Unity.dll
|
|
|
|
git add X10D.xml
|
|
|
|
git add X10D.Unity.xml
|
2023-03-29 16:03:48 +01:00
|
|
|
git add package.json
|
2023-03-29 15:00:00 +01:00
|
|
|
git commit -m "Update upm branch ($GITHUB_SHA)"
|
|
|
|
git push
|