Skip to content

Commit 68bb5b1

Browse files
committed
ci: Build plugin asset (#21)
1 parent af6a53c commit 68bb5b1

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: google-github-actions/release-please-action@v4
17+
id: release
1718
with:
1819
token: ${{ secrets.GITHUB_TOKEN }}
1920
release-type: simple
21+
22+
- uses: game-ci/unity-builder@v2
23+
if: ${{ steps.release.outputs.release_created }}
24+
env:
25+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
26+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
27+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
28+
with:
29+
unityVersion: 2022.3.19f1
30+
buildMethod: ExportPackage.Export
31+
customImage: "unityci/editor:ubuntu-2022.3.19f1-base-3"
32+
33+
- name: Upload Release Artifact
34+
if: ${{ steps.release.outputs.release_created }}
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: gh release upload ${{ steps.release.outputs.tag_name }} Rivet.unitypackage
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Linq;
2+
using UnityEditor;
3+
4+
/// <summary>
5+
/// Represents a class that exports a package containing assets related to the Rivet plugin.
6+
/// </summary>
7+
public class ExportPackage
8+
{
9+
/// <summary>
10+
/// Exports the assets related to the Rivet plugin as a Unity package.
11+
/// </summary>
12+
public static void Export()
13+
{
14+
string[] projectContent = AssetDatabase.GetAllAssetPaths();
15+
var assetsToExport = projectContent.Where(path => path.StartsWith("Assets/Rivet")).ToArray();
16+
AssetDatabase.ExportPackage(assetsToExport, "Rivet.unitypackage", ExportPackageOptions.Recurse);
17+
}
18+
}

Assets/Rivet/Editor/ExportPlugin.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)