Skip to content

Commit

Permalink
[CI] Fix template publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Oct 18, 2024
1 parent 1be8c51 commit cae5ede
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflow-scripts/publishTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflow-scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cae5ede

Please sign in to comment.