This commit is contained in:
bd_ 2022-09-07 20:46:13 -07:00
parent 47fd6ac04b
commit bb8eb3152d
3 changed files with 117 additions and 94 deletions

View File

@ -1,18 +0,0 @@
name: Build documentation
on:
push:
branches:
- test
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docusaurus BuildDeploy Action
uses: redkubes/docusaurus-deploy-action@v1.2
with:
source-folder: docs
git-user: docusaurus
git-password: ${{ secrets.GITHUB_TOKEN }}
deployment-branch: gh-pages

70
.github/workflows/build-pages.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: Build documentation
on:
push:
branches:
- test
env:
listPublishDirectory: docs/build
vpmSubDirectory: vpm
pathToCi: ci
jobs:
build-listing:
name: build-listing
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3 # check out this repo
- uses: actions/checkout@v3 # check out automation repo
with:
repository: vrchat-community/package-list-action
path: ${{env.pathToCi}}
clean: false # otherwise the local repo will no longer be checked out
- name: Build docs
run: |
cd docs
npm install
npm build
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
${{env.pathToCi}}/.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- name: Build Package Version Listing
run: ${{env.pathToCi}}/build.cmd BuildRepoListing --root ${{env.pathToCi}} --list-publish-directory $GITHUB_WORKSPACE/${{env.listPublishDirectory}}/${{env.vpmSubDirectory}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ${{env.listPublishDirectory}}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docusaurus BuildDeploy Action
uses: redkubes/docusaurus-deploy-action@v1.2
with:
source-folder: docs
git-user: docusaurus
git-password: ${{ secrets.GITHUB_TOKEN }}
deployment-branch: gh-pages

View File

@ -1,86 +1,57 @@
name: Build release artifacts name: Build Release
on: push on:
workflow_dispatch:
push:
branches: main
paths: Packages/net.fushizen.modular-avatar/**
env:
packageName: "net.fushizen.modular-avatar"
jobs: jobs:
build-unitypackage: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2
- name: Misc setup - name: Checkout
run: | uses: actions/checkout@v3
cp COPYING.md Assets/bd_/ModularAvatar/COPYING.txt
cp COPYING.md Packages/net.fushizen.modular-avatar/COPYING.txt - name: get version
mkdir output
cp COPYING.md output/COPYING.txt
- name: Generate VPM package
run: |
cd Packages/net.fushizen.modular-avatar && zip ../../output/ModularAvatar.vpm.zip -r .
- name: Generate filelists
run: |
find Packages/net.fushizen.modular-avatar -name '*.meta' >> metaList
cat metaList
- name: Build unitypackage
uses: pCYSl5EDgo/create-unitypackage@2f4ac82dabd3a1029f7a6771f30dc796e4217551
with:
package-path: 'output/modular-avatar-dev.unitypackage'
include-files: metaList
- name: Upload commit artifacts (dev .zip package)
uses: actions/upload-artifact@master
with:
path: output
name: modular-avatar-dev
- name: Set version based on tag
id: version id: version
if: startsWith(github.event.ref, 'refs/tags/') uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31
with:
path: "Packages/${{env.packageName}}/package.json"
prop_path: "version"
- run: echo ${{steps.version.outputs.prop}}
- name: Set Environment Variables
run: | run: |
echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV
- name: Rename and zip artifacts echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.prop }}.unitypackage" >> $GITHUB_ENV
if: startsWith(github.event.ref, 'refs/tags/')
run: | - name: Create Zip
mv output/modular-avatar-dev.unitypackage output/modular-avatar-${{ steps.version.outputs.version }}.unitypackage uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657
mv output/ModularAvatar.vpm.zip output/modular-avatar-${{ steps.version.outputs.version }}.vpm.zip
(cd output; zip ../modular-avatar-dev.zip *)
- name: Create draft release
if: startsWith(github.event.ref, 'refs/tags/')
uses: actions/create-release@v1
id: create_release
with: with:
draft: true type: "zip"
prerelease: false directory: "Packages/${{env.packageName}}/"
release_name: ${{ steps.version.outputs.version }} filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md - run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList
env:
GITHUB_TOKEN: ${{ github.token }} - name: Create UnityPackage
- name: Upload VPM release artifact uses: pCYSl5EDgo/create-unitypackage@e28c7a4616b2754c564b0a959a03b3c89b756fdb
if: startsWith(github.event.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} package-path: ${{ env.unityPackage }}
asset_path: output/modular-avatar-${{ steps.version.outputs.version }}.vpm.zip include-files: metaList
asset_name: modular-avatar-${{ steps.version.outputs.version }}.vpm.zip
asset_content_type: application/octet-stream
- name: Upload unitypackage release artifact - name: Make Release
if: startsWith(github.event.ref, 'refs/tags/') uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} tag_name: ${{ steps.version.outputs.prop }}
asset_path: output/modular-avatar-${{ steps.version.outputs.version }}.unitypackage files: |
asset_name: modular-avatar-${{ steps.version.outputs.version }}.unitypackage ${{ env.zipFile }}
asset_content_type: application/octet-stream ${{ env.unityPackage }}
- name: Upload zip release artifact Packages/${{ env.packageName }}/package.json
if: startsWith(github.event.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: modular-avatar-dev.zip
asset_name: avrc-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip