From 5aa8169e647d309aa4e0620d86099982306cf2de Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 10 Oct 2024 16:24:03 +0100 Subject: [PATCH] ci: Inline figma connect publish in on-release --- .github/publish_code_connect/action.yml | 10 ---------- .github/publish_code_connect/index.js | 13 ------------- .github/workflows/on-release.yml | 12 +++++------- 3 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 .github/publish_code_connect/action.yml delete mode 100644 .github/publish_code_connect/index.js diff --git a/.github/publish_code_connect/action.yml b/.github/publish_code_connect/action.yml deleted file mode 100644 index c57ed475..00000000 --- a/.github/publish_code_connect/action.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: "Publish Code Connect" -description: "Publish code connect files" -inputs: - figma-access-token: - description: "The personal access token given by Figma. Required to make API calls" - required: true - -runs: - using: "node20" - main: "index.js" diff --git a/.github/publish_code_connect/index.js b/.github/publish_code_connect/index.js deleted file mode 100644 index 495c1cb8..00000000 --- a/.github/publish_code_connect/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import core from "@actions/core"; -import util from "util"; -import { exec } from "child_process"; -const asyncExec = util.promisify(exec); - -const FIGMA_ACCESS_TOKEN = core.getInput("figma-access-token") || process.env.FIGMA_ACCESS_TOKEN; - -const { stdout, stderr } = await asyncExec(`npx figma connect publish --token ${FIGMA_ACCESS_TOKEN}`, { - cwd: "../..", -}); - -console.log(stdout); -console.error(stderr); diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index b61decaa..388ff46e 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -23,14 +23,12 @@ jobs: run: npm ci - name: Compile Typescript files run: tsc - - name: Publish - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # - name: Publish + # run: npm publish + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish code connect - uses: ./.github/publish_code_connect - with: - figma-access-token: ${{ secrets.FIGMA_PERSONAL_ACCESS_TOKEN }} + run: npx figma connect publish --token ${{ secrets.FIGMA_PERSONAL_ACCESS_TOKENf}} update_npm_dependencies: needs: publish