Skip to content

Commit

Permalink
Rework extensions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Dec 7, 2023
1 parent f68cda0 commit 3a0e008
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 181 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/deploy.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Process new extensions

on: [pull_request]

jobs:
deploy:
name: Deploy extensions
runs-on: ubuntu-latest
steps:
- name: Checkout extensions
uses: actions/checkout@v3
- name: Checkout dist
uses: actions/checkout@v3
with:
repository: moonlight-mod/extensions-dist
path: dist
ref: main
ssh-key: ${{ secrets.DIST_SSH_KEY }}
persist-credentials: true
- name: Checkout runner
uses: actions/checkout@v3
with:
repository: moonlight-mod/extensions-runner
path: runner
ref: main

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Build runner Docker image
uses: docker/build-push-action@v2
with:
context: ${{ github.workspace }}/runner
file: ${{ github.workspace }}/runner/Dockerfile
push: false
tags: moonlight-mod/extensions-runner:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run runner
env:
EXT_MANIFESTS_PATH: ${{ github.workspace }}/exts
EXT_DIST_PATH: ${{ github.workspace }}/dist
EXT_WORK_PATH: ${{ github.workspace }}/work
run: |
cd $EXT_RUNNER_PATH
pnpm run runner
cd $EXT_MANIFESTS_PATH
- name: Upload changed asars
uses: actions/upload-artifact@v2
with:
name: asars
path: ${{ github.workspace }}/work/changed/*.asar
75 changes: 75 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Process new extensions

on:
push:
branches:
- main

jobs:
deploy:
name: Deploy extensions
runs-on: ubuntu-latest
steps:
- name: Checkout extensions
uses: actions/checkout@v3
- name: Checkout dist
uses: actions/checkout@v3
with:
repository: moonlight-mod/extensions-dist
path: dist
ref: main
ssh-key: ${{ secrets.DIST_SSH_KEY }}
persist-credentials: true
- name: Checkout runner
uses: actions/checkout@v3
with:
repository: moonlight-mod/extensions-runner
path: runner
ref: main

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Build runner Docker image
uses: docker/build-push-action@v2
with:
context: ${{ github.workspace }}/runner
file: ${{ github.workspace }}/runner/Dockerfile
push: false
tags: moonlight-mod/extensions-runner:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run runner
env:
EXT_MANIFESTS_PATH: ${{ github.workspace }}/exts
EXT_DIST_PATH: ${{ github.workspace }}/dist
EXT_WORK_PATH: ${{ github.workspace }}/work
run: |
cd $EXT_RUNNER_PATH
pnpm run runner
cd $EXT_MANIFESTS_PATH
- name: Upload changed asars
uses: actions/upload-artifact@v2
with:
name: asars
path: ${{ github.workspace }}/work/changed/*.asar

- name: Commit dist
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DIST_TOKEN }}
directory: dist
repository: moonlight-mod/extensions-dist
ssh: true
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node_modules
# Built by CI
/exts/repo.json
/dist
/runner
/work
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

7 changes: 0 additions & 7 deletions README.md

This file was deleted.

25 changes: 0 additions & 25 deletions build.mjs

This file was deleted.

Empty file removed exts/.gitkeep
Empty file.
Binary file removed exts/domOptimizer.asar
Binary file not shown.
Binary file removed exts/emojiBlacklist.asar
Binary file not shown.
Binary file removed exts/moonlight-css.asar
Binary file not shown.
Binary file removed exts/noInlineLinks.asar
Binary file not shown.
Binary file removed exts/platformStyles.asar
Binary file not shown.
6 changes: 6 additions & 0 deletions exts/platformStyles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repository": "https://github.com/Cynosphere/moonlight-extensions.git",
"commit": "accf381859ca72eb624abc9ce04ec30c21982a87",
"scripts": ["build", "repo"],
"artifact": "repo/platformStyles.asar"
}
Binary file removed exts/removeChannelIcons.asar
Binary file not shown.
10 changes: 0 additions & 10 deletions package.json

This file was deleted.

89 changes: 0 additions & 89 deletions pnpm-lock.yaml

This file was deleted.

0 comments on commit 3a0e008

Please sign in to comment.