From 0059e26666dceddba0075ba6309102fd168b34f1 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 19 Jun 2024 18:02:12 +0100 Subject: [PATCH] [LOCAL] Add release workflow for 0.75 --- .github/workflows/release.yaml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..61ae2ef --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,46 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: "The version of the template we want to release. For example 0.75.0-rc.0" + required: true + type: string + is_latest_on_npm: + description: "Whether we want to tag this template release as `latest` on NPM" + required: true + type: boolean + default: false + +jobs: + publish_template: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Setup node.js + uses: actions/setup-node@v4.0.0 + with: + node-version: 18 + - name: Update versions to input one + run: node updateTemplateVersion.js "${{ inputs.version }}" + - name: Publish NPM + run: npm publish --dry-run --tag "${{ inputs. }}" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Set NPM tags + run: | + VERSION="${{ inputs.version }}" + IS_LATEST_ON_NPM="${{ inputs.is_latest_on_npm }}" + if [[ "$IS_LATEST_ON_NPM" == "true" ]]; then + npm dist-tag add @react-native-community/template@$VERSION latest + fi + if [[ "$VERSION" == *"rc"* ]]; then + npm dist-tag add @react-native-community/template@$VERSION next + fi + if [[ "$GITHUB_REF_NAME" == *"-stable" ]]; then + npm dist-tag add @react-native-community/template@$VERSION $GITHUB_REF_NAME + fi + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}