From cae5ede0da21955723ad05ee90a7b5bd7f2ef068 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 18 Oct 2024 09:47:44 +0100 Subject: [PATCH] [CI] Fix template publishing --- .github/workflow-scripts/publishTemplate.js | 2 +- .github/workflow-scripts/utils.js | 2 +- .github/workflows/test-all.yml | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflow-scripts/publishTemplate.js b/.github/workflow-scripts/publishTemplate.js index 12221c1ae756b4..b0c8946b6793df 100644 --- a/.github/workflow-scripts/publishTemplate.js +++ b/.github/workflow-scripts/publishTemplate.js @@ -42,7 +42,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => { await github.rest.actions.createWorkflowDispatch({ owner: 'react-native-community', repo: 'template', - workflow_id: 'release.yml', + workflow_id: 'release.yaml', ref, inputs: { dry_run: dryRun, diff --git a/.github/workflow-scripts/utils.js b/.github/workflow-scripts/utils.js index 1c2b8a5d1f8dbd..ddbe2b210b8967 100644 --- a/.github/workflow-scripts/utils.js +++ b/.github/workflow-scripts/utils.js @@ -9,7 +9,7 @@ const {execSync} = require('child_process'); -function run(...cmd) { +function run(cmd) { return execSync(cmd, 'utf8').toString().trim(); } module.exports.run = run; diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index a4e1c92f3a602e..32cc2b1373cfaf 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -13,6 +13,25 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !contains(github.ref, 'stable')}} jobs: + test-publish-template: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Yarn + run: yarn install + - name: Publish @react-native-community/template + id: publish-template-to-npm + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }} + script: | + const {publishTemplate} = require('./.github/workflow-scripts/publishTemplate.js') + const version = "v0.76.0-rc.6" + const isDryRun = true + await publishTemplate(github, version, isDryRun); + console.log('Template published!'); + set_release_type: runs-on: ubuntu-latest outputs: