Skip to content

Commit fdb8683

Browse files
Allow2CEOruvnet
andcommitted
Add Asset Store packaging, store workflow, and version bumping
- packaging/asset-store/export-unitypackage.sh: builds .unitypackage without Unity Editor (gzipped tar with GUIDs) - packaging/asset-store/asset-store-metadata.json: submission template for Unity Asset Store - store-publish.yml: build .unitypackage on v* tags, attach to GitHub Release, optional Asset Store submission - scripts/bump-version.sh: single entry point for releasing, updates package.json, commits and tags All publishing is tag-driven: bump-version.sh → git push --tags → release.yml (UPM) + store-publish.yml (Asset Store) Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent d8e37db commit fdb8683

File tree

5 files changed

+585
-0
lines changed

5 files changed

+585
-0
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: Asset Store Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-unitypackage:
13+
name: Build .unitypackage
14+
runs-on: ubuntu-latest
15+
outputs:
16+
version: ${{ steps.version.outputs.version }}
17+
filename: ${{ steps.version.outputs.filename }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Extract version
24+
id: version
25+
run: |
26+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
27+
PKG_VERSION=$(python3 -c "import json; print(json.load(open('com.allow2.sdk/package.json'))['version'])")
28+
29+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
30+
echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
31+
exit 1
32+
fi
33+
34+
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
35+
echo "filename=Allow2SDK-${PKG_VERSION}.unitypackage" >> "$GITHUB_OUTPUT"
36+
echo "Building .unitypackage for v$PKG_VERSION"
37+
38+
- name: Build .unitypackage
39+
run: |
40+
chmod +x packaging/asset-store/export-unitypackage.sh
41+
./packaging/asset-store/export-unitypackage.sh --version "${{ steps.version.outputs.version }}"
42+
43+
- name: Verify package
44+
run: |
45+
FILENAME="${{ steps.version.outputs.filename }}"
46+
47+
if [ ! -f "$FILENAME" ]; then
48+
echo "::error::Expected output file $FILENAME not found"
49+
exit 1
50+
fi
51+
52+
# Verify it is a valid gzipped tar
53+
if ! file "$FILENAME" | grep -q "gzip"; then
54+
echo "::error::$FILENAME is not a valid gzip archive"
55+
exit 1
56+
fi
57+
58+
# List contents to verify structure
59+
echo "Package contents (first 30 entries):"
60+
tar -tzf "$FILENAME" | head -30
61+
62+
# Verify Assets/Allow2 paths exist
63+
if ! tar -tzf "$FILENAME" | grep -q "pathname"; then
64+
echo "::error::Package does not contain pathname entries — invalid .unitypackage structure"
65+
exit 1
66+
fi
67+
68+
echo "Package verified: $(du -h "$FILENAME" | cut -f1)"
69+
70+
- name: Upload artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: unitypackage
74+
path: ${{ steps.version.outputs.filename }}
75+
retention-days: 90
76+
77+
attach-to-release:
78+
name: Attach to GitHub Release
79+
needs: build-unitypackage
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Download artifact
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: unitypackage
86+
87+
- name: Wait for release to exist
88+
env:
89+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
GH_REPO: ${{ github.repository }}
91+
run: |
92+
VERSION="${{ needs.build-unitypackage.outputs.version }}"
93+
TAG="v${VERSION}"
94+
95+
# The release.yml workflow may still be creating the release.
96+
# Poll for up to 5 minutes (30 attempts, 10s apart).
97+
for i in $(seq 1 30); do
98+
if gh release view "$TAG" > /dev/null 2>&1; then
99+
echo "Release $TAG found."
100+
exit 0
101+
fi
102+
echo "Waiting for release $TAG to be created... (attempt $i/30)"
103+
sleep 10
104+
done
105+
106+
echo "::error::Release $TAG was not found after 5 minutes"
107+
exit 1
108+
109+
- name: Upload .unitypackage to release
110+
env:
111+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
GH_REPO: ${{ github.repository }}
113+
run: |
114+
VERSION="${{ needs.build-unitypackage.outputs.version }}"
115+
FILENAME="${{ needs.build-unitypackage.outputs.filename }}"
116+
TAG="v${VERSION}"
117+
118+
gh release upload "$TAG" "$FILENAME" --clobber
119+
120+
echo "Attached $FILENAME to release $TAG"
121+
122+
submit-asset-store:
123+
name: Submit to Asset Store
124+
needs: [build-unitypackage, attach-to-release]
125+
runs-on: ubuntu-latest
126+
if: vars.ENABLE_ASSET_STORE == 'true'
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- name: Download artifact
131+
uses: actions/download-artifact@v4
132+
with:
133+
name: unitypackage
134+
135+
- name: Submit to Unity Asset Store
136+
env:
137+
UNITY_ASSET_STORE_TOKEN: ${{ secrets.UNITY_ASSET_STORE_TOKEN }}
138+
run: |
139+
VERSION="${{ needs.build-unitypackage.outputs.version }}"
140+
FILENAME="${{ needs.build-unitypackage.outputs.filename }}"
141+
142+
echo "============================================================"
143+
echo " Asset Store Submission — v${VERSION}"
144+
echo "============================================================"
145+
echo ""
146+
147+
if [ -z "${UNITY_ASSET_STORE_TOKEN:-}" ]; then
148+
echo "::warning::UNITY_ASSET_STORE_TOKEN secret is not set."
149+
echo ""
150+
echo "Automated Asset Store submission is not yet available."
151+
echo "Unity does not currently provide a public API for automated"
152+
echo "package submission. Follow the manual steps below."
153+
echo ""
154+
echo "MANUAL SUBMISSION STEPS:"
155+
echo "========================"
156+
echo ""
157+
echo "1. Open Unity Editor (2021.3+)"
158+
echo ""
159+
echo "2. Install Asset Store Tools:"
160+
echo " Window > Package Manager > + > Add package by name"
161+
echo " Enter: com.unity.asset-store-tools"
162+
echo ""
163+
echo "3. Open Asset Store Tools:"
164+
echo " Window > Asset Store Tools > Package Upload"
165+
echo ""
166+
echo "4. Log in with your Unity Publisher account"
167+
echo ""
168+
echo "5. Select your package draft or create a new one:"
169+
echo " - Title: Allow2 Parental Freedom SDK"
170+
echo " - Category: Tools/Integration"
171+
echo " - Price: Free"
172+
echo ""
173+
echo "6. Upload method — choose ONE:"
174+
echo ""
175+
echo " a) Pre-built .unitypackage (recommended for CI):"
176+
echo " - Download $FILENAME from the GitHub Release"
177+
echo " - Use 'Upload from .unitypackage' option"
178+
echo ""
179+
echo " b) From project folder:"
180+
echo " - Import the package into a Unity project"
181+
echo " - Select Assets/Allow2 as the upload root"
182+
echo ""
183+
echo "7. Fill in metadata from:"
184+
echo " packaging/asset-store/asset-store-metadata.json"
185+
echo ""
186+
echo "8. Upload key images (see metadata for required sizes)"
187+
echo ""
188+
echo "9. Submit for review"
189+
echo ""
190+
echo "Review typically takes 5-10 business days."
191+
exit 0
192+
fi
193+
194+
# If Unity provides an API in the future, automated submission
195+
# would go here. For now, this is a placeholder.
196+
echo "Asset Store token is set but automated submission API"
197+
echo "is not yet implemented. Follow manual steps above."

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# build
55
[Oo]bj/
66
[Bb]in/
7+
*.unitypackage
78
packages/
89
TestResults/
910

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"title": "Allow2 Parental Freedom SDK",
3+
"category": "Tools/Integration",
4+
"description": "Integrate Allow2 Parental Freedom into your Unity game or app. Provides a complete SDK for device pairing, child identification, real-time permission checks with automatic polling, progressive warnings and countdowns, block screens, time and activity requests, offline support with voice code challenge-response, and developer feedback.\n\nDesigned around the Allow2 Device API lifecycle: pair once, identify the child each session, check continuously, warn progressively, block when needed, and let the child request changes.\n\nNo additional dependencies required. Pure C# implementation using UnityWebRequest.",
5+
"key_features": [
6+
"QR/PIN device pairing with Allow2 platform",
7+
"Child identification with PIN verification",
8+
"Real-time permission checking (configurable 30-60s polling)",
9+
"Progressive warning system (15min, 5min, 1min, 30s, 10s, blocked)",
10+
"Block screen enforcement",
11+
"Request system (more time, day type change, ban lift)",
12+
"Offline support with cached permissions",
13+
"Voice code challenge-response for offline approvals",
14+
"Bug report and feature request feedback",
15+
"Event-driven architecture with C# events and UnityEvents"
16+
],
17+
"key_images": {
18+
"icon": "Images/icon_128x128.png (required: 128x128)",
19+
"card": "Images/card_420x280.png (required: 420x280)",
20+
"cover": "Images/cover_1950x1300.png (required: 1950x1300)",
21+
"social": "Images/social_1200x630.png (recommended: 1200x630)",
22+
"screenshots": [
23+
"Images/screenshot_01.png (recommended: 1920x1080, pairing flow)",
24+
"Images/screenshot_02.png (recommended: 1920x1080, child selection)",
25+
"Images/screenshot_03.png (recommended: 1920x1080, warning overlay)",
26+
"Images/screenshot_04.png (recommended: 1920x1080, block screen)",
27+
"Images/screenshot_05.png (recommended: 1920x1080, request dialog)"
28+
]
29+
},
30+
"unity_versions": {
31+
"minimum": "2021.3",
32+
"tested": ["2021.3", "2022.3", "2023.2", "6000.0"],
33+
"srp_compatibility": ["Built-in", "URP", "HDRP"]
34+
},
35+
"platforms": [
36+
"Windows",
37+
"macOS",
38+
"Linux",
39+
"Android",
40+
"iOS",
41+
"WebGL"
42+
],
43+
"dependencies": [],
44+
"publisher": {
45+
"name": "Allow2 Pty Ltd",
46+
"url": "https://developer.allow2.com",
47+
"support_email": "support@allow2.com"
48+
},
49+
"documentation_url": "https://github.com/Allow2/allow2unity",
50+
"license": "MIT",
51+
"price": "FREE",
52+
"submission_notes": "This is the official Allow2 Parental Freedom SDK. It communicates with the Allow2 platform API (api.allow2.com) to enforce parental freedom settings in games and apps. No native plugins or platform-specific code — pure C# using UnityWebRequest."
53+
}

0 commit comments

Comments
 (0)