From 7a119fc3c1f3f634179ecd215b663da8a06bbc20 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 29 Mar 2023 15:00:00 +0100 Subject: [PATCH] ci(upm): automate upm branch update (resolves #69) --- .github/workflows/nightly.yml | 22 ++++++++++++++++++++++ .github/workflows/prerelease.yml | 22 ++++++++++++++++++++++ .github/workflows/release.yml | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 119e929..ce587d0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,3 +41,25 @@ jobs: - 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 + + - name: Checkout upm branch + uses: actions/checkout@v3 + with: + ref: upm + path: upm + + - name: Commit update + run: | + cd upm + cp ../X10D/bin/Debug/netstandard2.1/X10D.dll ./X10D.dll + cp ../X10D/bin/Debug/netstandard2.1/X10D.xml ./X10D.xml + cp ../X10D.Unity/bin/Debug/netstandard2.1/X10D.Unity.dll ./X10D.Unity.dll + cp ../X10D.Unity/bin/Debug/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 + git commit -m "Update upm branch ($GITHUB_SHA)" + git push diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 42034ee..8edc446 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -47,3 +47,25 @@ jobs: with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: true + + - name: Checkout upm branch + uses: actions/checkout@v3 + with: + ref: upm + path: upm + + - 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 + git commit -m "Update upm branch ($GITHUB_SHA)" + git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59a0495..f91543e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,3 +47,25 @@ jobs: with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false + + - name: Checkout upm branch + uses: actions/checkout@v3 + with: + ref: upm + path: upm + + - 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 + git commit -m "Update upm branch ($GITHUB_SHA)" + git push