From ef290fe28ea16e0228d7f8429b35f2ed9af37d54 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 25 Nov 2024 14:07:46 +0900 Subject: [PATCH] chore: updated deploy script --- .github/workflows/update-configuration.yml | 52 +++------------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/.github/workflows/update-configuration.yml b/.github/workflows/update-configuration.yml index 2490c49..da66e64 100644 --- a/.github/workflows/update-configuration.yml +++ b/.github/workflows/update-configuration.yml @@ -1,4 +1,4 @@ -name: "Update Configuration" +name: "Update Configuration and Build" on: workflow_dispatch: @@ -6,53 +6,15 @@ on: jobs: update: - name: "Update Configuration in manifest.json" + name: "Update Configuration & Build" runs-on: ubuntu-latest permissions: write-all steps: - - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 + - uses: ubiquity-os/action-deploy-plugin@main with: - node-version: "20.10.0" - - - name: Install deps and run configuration update - run: | - yarn install --immutable --immutable-cache --check-cache - yarn tsc --noCheck --project tsconfig.json - - - name: Update manifest configuration using GitHub Script - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const path = require('path'); - - const { pluginSettingsSchema } = require('./src/types'); - - const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json'); - const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); - - const configuration = JSON.stringify(pluginSettingsSchema); - - manifest["configuration"] = JSON.parse(configuration); - - const updatedManifest = JSON.stringify(manifest, null, 2) - console.log('Updated manifest:', updatedManifest); - fs.writeFileSync(manifestPath, updatedManifest); - - - name: Commit and Push generated types - run: | - git config --global user.name 'ubiquity-os[bot]' - git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com' - git add ./manifest.json - if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then - git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed" - git push origin HEAD:${{ github.ref_name }} - else - echo "No changes to commit" - fi + treatAsEsm: true + sourcemap: false env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + APP_ID: ${{ secrets.APP_ID }} + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}