Skip to content

Commit

Permalink
change demo url, change license, add package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic853 committed Aug 18, 2024
1 parent 1c765f9 commit 4b311ee
Show file tree
Hide file tree
Showing 6 changed files with 361 additions and 507 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Check and Publish Version

on:
push:
branches:
- main
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
id-token: write

jobs:
publish:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Bump version
id: read_version
run: |
git fetch --prune --unshallow
last_tag=$(git describe --tags --abbrev=0 HEAD~|| echo "0.0.0")
current_version=$(npm pkg get version --workspaces=false | tr -d \")
name=$(npm pkg get name --workspaces=false | tr -d \")
echo "Latest Tag: $last_tag"
echo "Current Version: $current_version"
echo "last_tag=$last_tag" >> $GITHUB_OUTPUT
echo "current_version=$current_version" >> $GITHUB_OUTPUT
echo "name=$name" >> $GITHUB_OUTPUT
- name: Checkout repository to Packages
uses: actions/checkout@v4
with:
path: Packages/${{ steps.read_version.outputs.name }}

- name: Create Tag
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
uses: rickstaa/action-create-tag@v1
with:
tag: "${{ steps.read_version.outputs.current_version }}"

- name: Create ZIP archive
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
run: |
zip -r ${{ steps.read_version.outputs.name }}-${{ steps.read_version.outputs.current_version }}.zip . -x ".git*" ".github*" "Packages*"
- name: Read zip sha256
id: zip
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
run: echo "hash=$(shasum -a 256 ${{ steps.read_version.outputs.name }}-${{ steps.read_version.outputs.current_version }}.zip | awk '{ print $1 }')" >> $GITHUB_OUTPUT

- name: Track Package Meta Files
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
run: find "Packages/${{ steps.read_version.outputs.name }}" -name \*.meta >> metaList

- name: Create UnityPackage
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
uses: pCYSl5EDgo/create-unitypackage@master
with:
package-path: ${{ steps.read_version.outputs.name }}-${{ steps.read_version.outputs.current_version }}.unitypackage
include-files: metaList

- name: Release
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
uses: softprops/action-gh-release@v2
with:
body: |
### **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.read_version.outputs.last_tag }}...${{ steps.read_version.outputs.current_version }}
# Installation method (VCC):
Click the "Add Repository" button under Settings → Packages and enter the following URL:
https://page.853lab.com/vpm-repos/vpm.json
Then add the "${{ github.event.repository.name }}" package to the project.
# 安装方法(VCC):
在 Settings → Packages 下点击“Add Repository”按钮后输入以下URL:
https://page.853lab.com/vpm-repos/vpm.json
随后在项目添加“${{ github.event.repository.name }}”包。
## License restrictions 许可限制
Non-Mainland China (except China Hong Kong, China Macau, and China Taiwan) individuals or companies are subject to an LGPL license.
非中国大陆地区(中国香港、中国澳门和中国台湾除外)的个人或公司须遵守 LGPL 许可证。
Individuals or companies in mainland China (except China Hong Kong, China Macau, and China Taiwan) are prohibited from using this LGPL license and using this repository and products if the following circumstances apply:
中国大陆地区(中国香港、中国澳门和中国台湾除外)的个人或公司如含有以下任一情况禁止使用该 LGPL 许可并禁止使用此储存库以及商品(包括此储存库以及商品的任一文件):
1. 以公司、社团、社区名义创建的地图/世界
2. 地图/世界参与制作人数超过 2 人以上(不含 2 人)
3. 由 Sonic853 明确禁止的个人用户、公司
如需获得使用此储存库以及商品的授权,请联系作者 Sonic853 ([email protected]) 获取授权或访问 [爱发电](https://afdian.com/a/Sonic853) 手动获取授权。
tag_name: ${{ steps.read_version.outputs.current_version }}
files: |
${{ steps.read_version.outputs.name }}-${{ steps.read_version.outputs.current_version }}.zip
${{ steps.read_version.outputs.name }}-${{ steps.read_version.outputs.current_version }}.unitypackage
- name: Dispatch version to vpm-repos
if: steps.read_version.outputs.last_tag != steps.read_version.outputs.current_version
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: Sonic853/vpm-repos
event-type: publish-vpm
client-payload: '{"repository": "${{ github.repository }}", "path": "${{ github.event.repository.name }}", "name": "${{ steps.read_version.outputs.name }}", "version": "${{ steps.read_version.outputs.current_version }}", "hash": "${{ steps.zip.outputs.hash }}"}'
16 changes: 16 additions & 0 deletions Demo.unity
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ MonoBehaviour:
contentOther: 0
releasePublic: 0
unityVersion: 2022.3.6f1
udonProducts: []
Name:
NSFW: 0
SpawnPosition: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -412,26 +413,37 @@ MonoBehaviour:
NetworkIDs:
- gameObject: {fileID: 377745847}
ID: 10
SerializedTypeNames: []
- gameObject: {fileID: 1853056539}
ID: 11
SerializedTypeNames: []
- gameObject: {fileID: 237478439}
ID: 12
SerializedTypeNames: []
- gameObject: {fileID: 1565566542}
ID: 13
SerializedTypeNames: []
- gameObject: {fileID: 525910463}
ID: 14
SerializedTypeNames: []
- gameObject: {fileID: 561527177}
ID: 15
SerializedTypeNames: []
- gameObject: {fileID: 679443320}
ID: 16
SerializedTypeNames: []
- gameObject: {fileID: 985599668}
ID: 17
SerializedTypeNames: []
- gameObject: {fileID: 1875223860}
ID: 18
SerializedTypeNames: []
- gameObject: {fileID: 168587784}
ID: 19
SerializedTypeNames: []
portraitCameraPositionOffset: {x: 0, y: 0, z: 0}
portraitCameraRotationOffset: {x: 0, y: 1, z: 0, w: -0.00000004371139}
NavigationAreas: []
--- !u!4 &168587789
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -806,6 +818,10 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2605787817858188809, guid: 2e6d4da05b9372e44a379d1f42b5f6b5, type: 3}
propertyPath: url.url
value: https://page.853lab.com/Static_library/example/2046x2048_example.png
objectReference: {fileID: 0}
- target: {fileID: 2605787817858188809, guid: 2e6d4da05b9372e44a379d1f42b5f6b5, type: 3}
propertyPath: serializationData.Prefab
value:
Expand Down
Loading

0 comments on commit 4b311ee

Please sign in to comment.