Skip to content

feat: VPM listing #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
78 changes: 78 additions & 0 deletions .github/workflows/build-listing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build Repo Listing

env:
listPublishDirectory: Website
pathToCi: ci

on:
workflow_dispatch:
workflow_run:
workflows: [Build Release]
types:
- completed
release:
types: [published, created, edited, unpublished, deleted, released]

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

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:

# Build the VPM Listing Website and deploy to GitHub Pages
build-listing:
name: build-listing
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:

# Checkout Local Repository
- name: Checkout Local Repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

# Checkout Automation Repository without removing prior checkouts
- name: Checkout Automation Repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
repository: vrchat-community/package-list-action
path: ${{ env.pathToCi }}
clean: false

# Load cached data from previous runs
- name: Restore Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
${{ env.pathToCi }}/.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}

# Build Package Version Listing with Nuke
- name: Build Package Version Listing
run: ${{ env.pathToCi }}/build.cmd BuildRepoListing --root ${{ env.pathToCi }} --list-publish-directory $GITHUB_WORKSPACE/${{ env.listPublishDirectory }} --current-package-name sh.orels.udontoolkit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Prepare for GitHub Pages deployment
- name: Setup Pages
uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382

# Upload the VPM Listing Website to GitHub Pages artifacts
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c
with:
path: ${{ env.listPublishDirectory }}

# Deploy the uploaded VPM Listing Website to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Release

on:
workflow_dispatch:

jobs:
# Build and release the Package
# If the repository is not configured properly, this job will be skipped
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
packageName: "sh.orels.udontoolkit"
zipFile: ""
unityPackage: ""
version: ""
steps:

# Checkout Local Repository
- name: Checkout
uses: actions/checkout@v4

# Get the Package version based on the package.json file
- name: Get Version
id: version
uses: zoexx/github-action-json-file-properties@release
with:
file_path: "Packages/${{ env.packageName }}/package.json"
prop_path: "version"

# Configure the Environment Variables needed for releasing the Package
- name: Set Environment Variables
run: |
echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV
echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV
echo "version=${{ steps.version.outputs.value }}" >> $GITHUB_ENV

# Zip the Package for release
- name: Create Package Zip
working-directory: "Packages/${{ env.packageName }}"
run: zip -r "${{ github.workspace }}/${{ env.zipFile }}" .

# Build a list of .meta files for future use
- name: Track Package Meta Files
run: find "Packages/${{ env.packageName }}/" -name \*.meta >> metaList

# Make a UnityPackage version of the Package for release
- name: Create UnityPackage
uses: pCYSl5EDgo/[email protected]
with:
package-path: ${{ env.unityPackage }}
include-files: metaList

# Make a release tag of the version from the package.json file
- name: Create Tag
id: tag_version
uses: rickstaa/action-create-tag@88dbf7ff6fe2405f8e8f6c6fdfd78829bc631f83
with:
tag: "${{ env.version }}"

# Publish the Release to GitHub
- name: Make Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: |
${{ env.zipFile }}
${{ env.unityPackage }}
Packages/${{ env.packageName }}/package.json
tag_name: ${{ env.version }}
32 changes: 14 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# This .gitignore file should be placed at the root of your Unity project directory
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Mm]emoryCaptures/

# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
/[Aa]ssets/**/*
!/[Aa]ssets/.gitkeep

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/
Expand Down Expand Up @@ -50,18 +50,14 @@ sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

.idea/.idea.vpm-package-maker/.idea
Assets/PackageMakerWindowData.asset*
.idea
/*/*.idea
.vscode

UserSettings
Empty file added Assets/.gitkeep
Empty file.
Loading