Compare commits
4
Commits
v0.1.0
...
7de7bbbcdc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7de7bbbcdc | ||
|
|
182bacbb09 | ||
|
|
098c4b098f | ||
|
|
deea36068c |
@@ -15,22 +15,39 @@ jobs:
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
||||
steps:
|
||||
- name: Fetch tagged revision
|
||||
- name: Fetch exact tagged release archive
|
||||
env:
|
||||
GITEA_REF: ${{ gitea.ref }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
ref="${{ gitea.sha }}"
|
||||
test -n "$ref"
|
||||
git init .
|
||||
git remote add origin "https://git.crash.work/ShrinkSDK/Installer.git"
|
||||
git fetch --depth=1 origin "$ref"
|
||||
git checkout --detach FETCH_HEAD
|
||||
tag="${GITEA_REF#refs/tags/}"
|
||||
case "$tag" in
|
||||
v[0-9]*) ;;
|
||||
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
|
||||
esac
|
||||
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/ShrinkSDK/Installer/archive/${tag}.tar.gz"
|
||||
node --input-type=module <<'NODE'
|
||||
import { writeFile } from 'node:fs/promises';
|
||||
|
||||
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
|
||||
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
|
||||
NODE
|
||||
mkdir release
|
||||
tar -xzf release.tar.gz --strip-components=1 -C release
|
||||
rm -f release.tar.gz
|
||||
printf '%s' "$tag" > release/.shrink-sdk-release-tag
|
||||
|
||||
- name: Validate immutable release version
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
tag="$(git describe --exact-match --tags HEAD)"
|
||||
cd release
|
||||
tag="$(cat .shrink-sdk-release-tag)"
|
||||
version="$(node -p "require('./package.json').version")"
|
||||
test "$tag" = "v$version"
|
||||
npm pack --dry-run
|
||||
@@ -40,10 +57,11 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
||||
cd release
|
||||
npmrc="$HOME/.npmrc"
|
||||
cleanup() { rm -f "$npmrc"; }
|
||||
trap cleanup EXIT
|
||||
printf '%s\n' \
|
||||
'registry=https://git.crash.work/api/packages/ShrinkSDK/npm/' \
|
||||
'//git.crash.work/api/packages/ShrinkSDK/npm/:_authToken=${NODE_AUTH_TOKEN}' > "$npmrc"
|
||||
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
||||
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eac67073f2eb71043bb104ae8931248b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87984663a86071f408003b68afa18e0c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,7 +14,6 @@ namespace ShrinkSDK.Installer
|
||||
{
|
||||
private AddRequest? _addRequest;
|
||||
private ListRequest? _listRequest;
|
||||
private ResolveRequest? _resolveRequest;
|
||||
private ShrinkSdkPackageEntry? _pendingInstall;
|
||||
private int _selectedPackageIndex;
|
||||
private string _status = "Ready";
|
||||
@@ -70,27 +69,10 @@ namespace ShrinkSDK.Installer
|
||||
EditorGUILayout.HelpBox(_status, _statusType);
|
||||
}
|
||||
|
||||
private bool IsBusy => _resolveRequest != null || _addRequest != null || _listRequest != null;
|
||||
private bool IsBusy => _addRequest != null || _listRequest != null;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_resolveRequest != null && _resolveRequest.IsCompleted)
|
||||
{
|
||||
var request = _resolveRequest;
|
||||
_resolveRequest = null;
|
||||
if (request.Status != StatusCode.Success)
|
||||
{
|
||||
SetStatus("Registry resolve failed: " + request.Error.message, MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_pendingInstall != null)
|
||||
{
|
||||
_addRequest = Client.Add(_pendingInstall.PackageSpecifier);
|
||||
SetStatus("Installing " + _pendingInstall.PackageSpecifier, MessageType.Info);
|
||||
}
|
||||
}
|
||||
|
||||
if (_addRequest != null && _addRequest.IsCompleted)
|
||||
{
|
||||
var request = _addRequest;
|
||||
@@ -129,8 +111,8 @@ namespace ShrinkSDK.Installer
|
||||
{
|
||||
ShrinkSdkManifestStore.EnsureShrinkSdkRegistry();
|
||||
_pendingInstall = null;
|
||||
_resolveRequest = Client.Resolve();
|
||||
SetStatus("Registry configuration written. Resolving packages.", MessageType.Info);
|
||||
Client.Resolve();
|
||||
SetStatus("Registry configuration written. Unity is resolving packages.", MessageType.Info);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -143,9 +125,10 @@ namespace ShrinkSDK.Installer
|
||||
try
|
||||
{
|
||||
ShrinkSdkManifestStore.EnsureShrinkSdkRegistry();
|
||||
Client.Resolve();
|
||||
_pendingInstall = entry;
|
||||
_resolveRequest = Client.Resolve();
|
||||
SetStatus("Resolving registry for " + entry.PackageSpecifier, MessageType.Info);
|
||||
_addRequest = Client.Add(entry.PackageSpecifier);
|
||||
SetStatus("Installing " + entry.PackageSpecifier, MessageType.Info);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87b0b212685b2564eaa5586bb567bfab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7a718e89696b5d499781f9b04f63c27
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -47,7 +47,7 @@ namespace ShrinkSDK.Installer
|
||||
new ShrinkSdkPackageEntry("ShrinkDataSaver Integration EventBus", "com.cneicy.shrink-datasaver-integration-eventbus", "2.1.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkEventBus", "com.cneicy.shrink-eventbus", "2.0.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkEventBus Entities", "com.cneicy.shrink-eventbus-entities", "0.1.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkModFramework", "com.cneicy.shrink-mod-framework", "0.2.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkModFramework", "com.cneicy.shrink-mod-framework", "0.2.1"),
|
||||
new ShrinkSdkPackageEntry("ShrinkNetwork", "com.cneicy.shrink-network", "0.2.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkNetwork Integration App", "com.cneicy.shrink-network-integration-app", "0.1.0"),
|
||||
new ShrinkSdkPackageEntry("ShrinkNetwork Integration EventBus", "com.cneicy.shrink-network-integration-eventbus", "0.1.1"),
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a785469a5003c64ba3c5a7663d703fb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -9,5 +9,5 @@ The installer does not copy templates into `Assets`, does not store credentials,
|
||||
## Bootstrap URL
|
||||
|
||||
```text
|
||||
https://git.crash.work/ShrinkSDK/Installer.git#v0.1.0
|
||||
https://git.crash.work/ShrinkSDK/Installer.git#v0.1.2
|
||||
```
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cce500f16cff60c4a975bb202bc57b0c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.cneicy.shrink-installer",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.2",
|
||||
"displayName": "ShrinkSDK Installer",
|
||||
"description": "ShrinkSDK registry bootstrapper and fixed-version package installer.",
|
||||
"unity": "2022.3",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c41475e2d6261484695ef0f146b55a01
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user