mirror of
https://github.com/MrUnknownDE/vcc-tools.git
synced 2026-04-27 19:03:47 +02:00
rename repo "again" ^^
This commit is contained in:
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
@@ -3,13 +3,13 @@ name: VCC Release Automation
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*" # Startet bei v1.0.2, v1.1.0 etc.
|
- "v*" # Startet z.B. bei v1.0.3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write # Garantiert Rechte für Releases und Code-Pushes
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -19,45 +19,43 @@ jobs:
|
|||||||
- name: Extract Metadata
|
- name: Extract Metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(jq -r .version package.json)
|
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
||||||
PKG_NAME=$(jq -r .name package.json)
|
echo "pkg_name=$(jq -r .name package.json)" >> $GITHUB_OUTPUT
|
||||||
DISPLAY_NAME=$(jq -r .displayName package.json)
|
echo "display_name=$(jq -r .displayName package.json)" >> $GITHUB_OUTPUT
|
||||||
DESCRIPTION=$(jq -r .description package.json)
|
echo "description=$(jq -r .description package.json)" >> $GITHUB_OUTPUT
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "pkg_name=$PKG_NAME" >> $GITHUB_OUTPUT
|
|
||||||
echo "display_name=$DISPLAY_NAME" >> $GITHUB_OUTPUT
|
|
||||||
echo "description=$DESCRIPTION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create VCC Package Zip
|
- name: Create VCC Package Zip
|
||||||
run: |
|
run: |
|
||||||
# Wir packen nur die relevanten Dateien ohne den Repo-Hauptordner
|
|
||||||
zip -r ${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip package.json README.md Editor/ Editor.meta package.json.meta README.md.meta
|
zip -r ${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip package.json README.md Editor/ Editor.meta package.json.meta README.md.meta
|
||||||
|
|
||||||
- name: Upload GitHub Release Asset
|
- name: Upload GitHub Release Asset
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: ${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip
|
files: ${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip
|
||||||
generate_release_notes: true
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Update VCC Index
|
- name: Update VCC Index
|
||||||
run: |
|
run: |
|
||||||
# Wechsel zum gh-pages Branch (oder erstelle ihn, falls er fehlt)
|
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
git fetch origin gh-pages || git checkout --orphan gh-pages
|
# Prüfen, ob der gh-pages Branch auf dem Server existiert
|
||||||
git checkout gh-pages || git checkout -b gh-pages
|
if git ls-remote --heads origin gh-pages | grep -q gh-pages; then
|
||||||
|
git checkout gh-pages
|
||||||
# Falls die index.json noch nicht existiert, Basis-Struktur anlegen
|
else
|
||||||
if [ ! -f index.json ]; then
|
# Wenn nicht: Erstelle ihn als komplett leeren (orphan) Branch
|
||||||
echo '{"name":"mrunknownde VCC Repo","id":"de.mrunknownde.vccrepo","url":"https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/index.json","author":"mrunknownde","packages":{}}' > index.json
|
git checkout --orphan gh-pages
|
||||||
|
git rm -rf . # Löscht alle Main-Dateien aus diesem Branch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Neue Version in die index.json injizieren
|
# Basis-Struktur der index.json erstellen, falls sie noch nicht existiert
|
||||||
|
if [ ! -f index.json ]; then
|
||||||
|
echo '{"name":"mrunknownde VCC Tools","id":"de.mrunknownde.vccrepo","url":"https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/index.json","author":"mrunknownde","packages":{}}' > index.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
# URL zur gerade hochgeladenen ZIP-Datei im Release generieren
|
||||||
ZIP_URL="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip"
|
ZIP_URL="https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ steps.metadata.outputs.pkg_name }}-${{ github.ref_name }}.zip"
|
||||||
|
|
||||||
|
# Neue Version per jq sauber in die index.json injizieren
|
||||||
jq --arg ver "${{ steps.metadata.outputs.version }}" \
|
jq --arg ver "${{ steps.metadata.outputs.version }}" \
|
||||||
--arg name "${{ steps.metadata.outputs.pkg_name }}" \
|
--arg name "${{ steps.metadata.outputs.pkg_name }}" \
|
||||||
--arg disp "${{ steps.metadata.outputs.display_name }}" \
|
--arg disp "${{ steps.metadata.outputs.display_name }}" \
|
||||||
@@ -72,6 +70,13 @@ jobs:
|
|||||||
"url": $url
|
"url": $url
|
||||||
}' index.json > temp.json && mv temp.json index.json
|
}' index.json > temp.json && mv temp.json index.json
|
||||||
|
|
||||||
|
# Änderungen stagen
|
||||||
git add index.json
|
git add index.json
|
||||||
git commit -m "Add version ${{ github.ref_name }} to VCC index"
|
|
||||||
git push origin gh-pages
|
# Nur committen und pushen, wenn sich die JSON wirklich verändert hat (verhindert Action-Crash)
|
||||||
|
if ! git diff --cached --quiet; then
|
||||||
|
git commit -m "Auto-update VCC index.json for ${{ github.ref_name }}"
|
||||||
|
git push origin gh-pages
|
||||||
|
else
|
||||||
|
echo "Keine Änderungen an der index.json festgestellt. Überspringe Push."
|
||||||
|
fi
|
||||||
16
index.json
16
index.json
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "MrUnknownDE's VCC Tools",
|
"name": "MrUnknownDE's VCC Tools",
|
||||||
"id": "de.mrunknownde.vccrepo",
|
"id": "de.mrunknownde.vcc-tools",
|
||||||
"url": "https://vcc.mrunk.de/index.json",
|
"url": "https://vcc.mrunk.de/index.json",
|
||||||
"author": "mrunknownde",
|
"author": "mrunknownde",
|
||||||
"packages": {
|
"packages": {
|
||||||
"de.mrunknownde.gittool": {
|
"de.mrunknownde.vcc-tools": {
|
||||||
"versions": {
|
"versions": {
|
||||||
"1.0.1": {
|
"1.0.1": {
|
||||||
"name": "de.mrunknownde.gittool",
|
"name": "de.mrunknownde.vcc-tools",
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"displayName": "VRChat Git Control Tool",
|
"displayName": "VRChat Tools",
|
||||||
"url": "https://github.com/MrUnknownDE/unity-gittool/archive/refs/tags/v1.0.1.zip",
|
"url": "https://github.com/MrUnknownDE/vcc-tools/archive/refs/tags/v1.0.1.zip",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
"description": "A lightweight, integrated Git panel for Unity."
|
"description": "A lightweight, integrated Git panel for Unity."
|
||||||
},
|
},
|
||||||
"1.0.0": {
|
"1.0.0": {
|
||||||
"name": "de.mrunknownde.gittool",
|
"name": "de.mrunknownde.vcc-tools",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"displayName": "VRChat Git Control Tool",
|
"displayName": "VRChat Tools",
|
||||||
"url": "https://github.com/MrUnknownDE/unity-gittool/archive/refs/tags/v1.0.0.zip",
|
"url": "https://github.com/MrUnknownDE/vcc-tools/archive/refs/tags/v1.0.0.zip",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
"description": "A lightweight, integrated Git panel for Unity."
|
"description": "A lightweight, integrated Git panel for Unity."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "de.mrunknownde.gittool",
|
"name": "de.mrunknownde.vcc-tools",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"displayName": "VRChat Git Control Tool",
|
"displayName": "MrUnknownDE's VRChat Tools",
|
||||||
"description": "A lightweight, integrated Git panel for Unity. Ideal for VRChat World/Avatar Creators to easily push commits directly from the editor to Gitea/GitHub/GitLab and other Git hosting services.",
|
"description": "A lightweight, integrated Git panel for Unity.",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "mrunknownde"
|
"name": "MrUnknownDE"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"vpmDependencies": {}
|
"vpmDependencies": {}
|
||||||
|
|||||||
Reference in New Issue
Block a user