Skip to content

add the gh actions setup file #25

add the gh actions setup file

add the gh actions setup file #25

name: facebook/metro/build-and-deploy
on:
push:
defaults:
run:
shell: bash
jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml
publish-to-npm:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
with:
use-min-supported-version: true
- name: Check Tag Format
id: check_tag
run: |
if [[ $GITHUB_REF =~ ^refs/tags/v\d+(\.\d+){2}(-.*)?$ ]]; then
echo "valid=true" >> $GITHUB_OUTPUT
else
echo "valid=false" >> $GITHUB_OUTPUT
fi
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Infer dist-tag and run npm run publish
if: steps.check_tag.outputs.valid == 'true'
run: "./.circleci/scripts/publish.sh"
- run: rm ~/.npmrc