Compare commits
3
Commits
v0.1.0
..
continuous
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31affff9dd
|
||
|
|
d665a01a1f
|
||
|
|
41a3656d78 |
@@ -0,0 +1,48 @@
|
||||
name: continuous
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
continuous:
|
||||
name: Publish continuous release
|
||||
runs-on: nix
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build Rust core
|
||||
run: nix build .#aac --print-build-logs
|
||||
|
||||
- name: Package VPM zip
|
||||
env:
|
||||
VPM_VERSION: continuous
|
||||
VPM_RELEASE_BASE: ${{ github.server_url }}/${{ github.repository }}/releases/download/continuous
|
||||
run: nix develop -c bash ./vpm/package.sh
|
||||
|
||||
- name: Publish release and upload zip
|
||||
env:
|
||||
TOKEN: ${{ secrets.VPM_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
SERVER: ${{ github.server_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
TAG: continuous
|
||||
VPM_VERSION: continuous
|
||||
run: nix develop -c bash ./vpm/publish.sh
|
||||
|
||||
# The index carries the zip's sha256, which only exists after packaging.
|
||||
- name: Commit updated VPM index
|
||||
env:
|
||||
TOKEN: ${{ secrets.VPM_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
SERVER: ${{ github.server_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config user.name gitea-actions
|
||||
git config user.email actions@git.scug.io
|
||||
git add vpm/index.json
|
||||
git diff --cached --quiet && exit 0
|
||||
git commit -m "vpm: continuous index update"
|
||||
git push "https://x-access-token:$TOKEN@${SERVER#https://}/${REPO}.git" HEAD:main
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine;
|
||||
using AnimatorAsCode.V1;
|
||||
|
||||
namespace AnimatorAsCrab.V1
|
||||
{
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
"unity": "2019.4",
|
||||
"description": "Writes Animator Controllers from a Rhai script, evaluated by the libaac native library.",
|
||||
"url": "https://git.scug.io/doloro/av3-animation-as-crab/releases/download/v0.1.0/dev.doloro.animator-as-crab-0.1.0.zip",
|
||||
"zipSHA256": "63dc0241af2fd724b3b02572020db15236b00fd8f7931fbfbd22155c235b6017",
|
||||
"zipSHA256": "a2113de469c07b1dd1373fb76bbc90fa9f7a2d4855eca57fa3351c9754821af8",
|
||||
"dependencies": {
|
||||
"com.unity.nuget.newtonsoft-json": "3.2.1"
|
||||
},
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ index_url=${VPM_INDEX_URL:-$host/$project/raw/branch/main/vpm/index.json}
|
||||
release_base=${VPM_RELEASE_BASE:-}
|
||||
|
||||
id=$(jq -r .name "$pkg/package.json")
|
||||
version=$(jq -r .version "$pkg/package.json")
|
||||
version=${VPM_VERSION:-$(jq -r .version "$pkg/package.json")}
|
||||
zip_name="$id-$version.zip"
|
||||
: "${release_base:=$host/$project/releases/download/v$version}"
|
||||
zip_url="$release_base/$zip_name"
|
||||
|
||||
+11
-1
@@ -14,12 +14,22 @@ root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
manifest="$root/csharp/dev.doloro.animator-as-crab/package.json"
|
||||
|
||||
id=$(jq -r .name "$manifest")
|
||||
version=$(jq -r .version "$manifest")
|
||||
version=${VPM_VERSION:-$(jq -r .version "$manifest")}
|
||||
zip="$root/vpm/dist/$id-$version.zip"
|
||||
|
||||
zip_name=$(basename "$zip")
|
||||
[ -f "$zip" ] || { echo "missing $zip; run package.sh first" >&2; exit 1; }
|
||||
|
||||
# Delete existing release with same tag if present (needed for rolling tags like continuous)
|
||||
existing=$(curl -fsS -H "Authorization: token $TOKEN" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases/tags/$TAG" 2>/dev/null || true)
|
||||
if [ -n "$existing" ] && [ "$existing" != 'null' ]; then
|
||||
existing_id=$(jq -r .id <<<"$existing")
|
||||
echo "deleting existing release $existing_id for tag $TAG"
|
||||
curl -fsS -X DELETE -H "Authorization: token $TOKEN" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases/$existing_id"
|
||||
fi
|
||||
|
||||
release=$(curl -fsS -X POST \
|
||||
-H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases" \
|
||||
|
||||
Reference in New Issue
Block a user