From 85b2954e72a578caef8c18c81b590111f0cfe488 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 5 Feb 2024 14:58:44 +0100 Subject: [PATCH 1/3] changes following code review --- .github/workflows/ra-ee-npm.yml | 9 ++++----- .github/workflows/ra-ee-yarn.yml | 11 ++++++----- README.md | 26 +++++++++++++++++++------- action.yml | 4 ++-- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ra-ee-npm.yml b/.github/workflows/ra-ee-npm.yml index 8125aa6..71c3812 100644 --- a/.github/workflows/ra-ee-npm.yml +++ b/.github/workflows/ra-ee-npm.yml @@ -1,20 +1,19 @@ -name: RA-EE Action with NPM +name: Test RA-EE Action with NPM on: [page_build] jobs: ra_enterprise_action_workflow: runs-on: ubuntu-latest - name: Add ReactAdmin Enterprise Edition CI token + name: Add React Admin Enterprise Edition CI token steps: # To use this repository's private action, # you must check out the repository - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all the git history to enable git comparison - name: Token file creation uses: ./ + # Replace with the following line to test outside of this repository # uses: react-admin/ra-enterprise-action@1.0.0 env: - CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} + RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} - run: npm install diff --git a/.github/workflows/ra-ee-yarn.yml b/.github/workflows/ra-ee-yarn.yml index f70f407..d6e7be2 100644 --- a/.github/workflows/ra-ee-yarn.yml +++ b/.github/workflows/ra-ee-yarn.yml @@ -1,10 +1,10 @@ -name: RA-EE Action with Yarn +name: Test RA-EE Action with Yarn on: [page_build] jobs: ra_enterprise_action_workflow: runs-on: ubuntu-latest - name: Yarn v${{matrix.version}} - Add ReactAdmin Enterprise Edition CI token + name: Yarn v${{matrix.version}} - Add React Admin Enterprise Edition CI token strategy: matrix: version: ["1.22.21", "2.4.3", "3.6.4", "4.0.0"] @@ -13,15 +13,16 @@ jobs: # you must check out the repository - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 # Fetch all the git history to enable git comparison - name: Token file creation uses: ./ + # Replace with the following line to test outside of this repository # uses: react-admin/ra-enterprise-action@1.0.0 env: - CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} + RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} - run: yarn set version ${{matrix.version}} - run: yarn -v - run: yarn install env: + # The following is necessary to allow yarn to use a different version + # than the one included in the base image YARN_ENABLE_IMMUTABLE_INSTALLS: false diff --git a/README.md b/README.md index 1b45527..ce0f155 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,39 @@ -# ReactAdmin Enterprise Edition action +# React Admin Enterprise Edition action -This action sets up your ReactAdmin Enterprise Edition authentication by creating a `.npmrc` file (or an `.yarnrc.yml` file if you use Yarn v2 or more) and adding your secret token that you can find on your [ReactAdmin Enterprise Edition setup page](https://registry.marmelab.com/setup) to use [private modules](https://marmelab.com/ra-enterprise/#private-modules). +This action sets up your package manager (`npm` or `yarn`) to use the [React Admin Enterprise Edition](https://marmelab.com/ra-enterprise/) private registry, which is required to download the [private modules](https://marmelab.com/ra-enterprise/#private-modules). + +It works by creating a `.npmrc` file (or a `.yarnrc.yml` file if you use Yarn v2 or more) and adding the CI authentication token found on the [React Admin Enterprise Edition setup page](https://registry.marmelab.com/setup). ## Environnement variable ### `RA_EE_CI_TOKEN` -You have to provide your ReactAdmin Enterprise Edition secret CI token. Do not paste it directly in your repository but use [Github Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) instead. +You need to provide your React Admin Enterprise Edition CI authentication token in the `RA_EE_CI_TOKEN` environment variable. + +**Notice:** Do not paste it directly in your repository but use [Github Encrypted Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) instead. ## Example usage Create a file: `.github/workflows/ra-ee.yml` -``` -name: ReactAdmin Enterprise Edition CI token Action +```yml +name: React Admin Enterprise Edition CI token Action on: [push] jobs: ra_enterprise_action_workflow: runs-on: ubuntu-latest - name: Add ReactAdmin Enterprise Edition CI token steps: - - uses: react-admin/ra-enterprise-action@1.0.0 + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js LTS + uses: actions/setup-node@v3 + with: + node-version: '16' + - name: Add React Admin Enterprise Edition CI token + uses: react-admin/ra-enterprise-action@1.0.0 env: RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} + - name: NPM install + run: npm install ``` diff --git a/action.yml b/action.yml index 98d7a3d..8649b4a 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: "ReactAdmin Enterprise Edition Action" +name: "React Admin Enterprise Edition Action" description: "Set up your CI to install EE packages" author: "Marmelab" branding: @@ -6,7 +6,7 @@ branding: color: "blue" env: RA_EE_CI_TOKEN: - description: "ReactAdmin Enterprise Edition secret CI token" + description: "React Admin Enterprise Edition CI authentication token" required: true runs: using: "composite" From ea02f26f98d11faf216de8e19e1123b8beed08dc Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 5 Feb 2024 15:09:07 +0100 Subject: [PATCH 2/3] remove tests as they were moved to another project --- .github/workflows/ra-ee-npm.yml | 19 ------------------- .github/workflows/ra-ee-yarn.yml | 28 ---------------------------- 2 files changed, 47 deletions(-) delete mode 100644 .github/workflows/ra-ee-npm.yml delete mode 100644 .github/workflows/ra-ee-yarn.yml diff --git a/.github/workflows/ra-ee-npm.yml b/.github/workflows/ra-ee-npm.yml deleted file mode 100644 index 71c3812..0000000 --- a/.github/workflows/ra-ee-npm.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Test RA-EE Action with NPM -on: [page_build] - -jobs: - ra_enterprise_action_workflow: - runs-on: ubuntu-latest - name: Add React Admin Enterprise Edition CI token - steps: - # To use this repository's private action, - # you must check out the repository - - name: Checkout - uses: actions/checkout@v2 - - name: Token file creation - uses: ./ - # Replace with the following line to test outside of this repository - # uses: react-admin/ra-enterprise-action@1.0.0 - env: - RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} - - run: npm install diff --git a/.github/workflows/ra-ee-yarn.yml b/.github/workflows/ra-ee-yarn.yml deleted file mode 100644 index d6e7be2..0000000 --- a/.github/workflows/ra-ee-yarn.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test RA-EE Action with Yarn -on: [page_build] - -jobs: - ra_enterprise_action_workflow: - runs-on: ubuntu-latest - name: Yarn v${{matrix.version}} - Add React Admin Enterprise Edition CI token - strategy: - matrix: - version: ["1.22.21", "2.4.3", "3.6.4", "4.0.0"] - steps: - # To use this repository's private action, - # you must check out the repository - - name: Checkout - uses: actions/checkout@v2 - - name: Token file creation - uses: ./ - # Replace with the following line to test outside of this repository - # uses: react-admin/ra-enterprise-action@1.0.0 - env: - RA_EE_CI_TOKEN: ${{secrets.RA_EE_CI_TOKEN}} - - run: yarn set version ${{matrix.version}} - - run: yarn -v - - run: yarn install - env: - # The following is necessary to allow yarn to use a different version - # than the one included in the base image - YARN_ENABLE_IMMUTABLE_INSTALLS: false From 465ac90f0e3e26851387ae77c3daeb2e375850ea Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kaiser Date: Mon, 5 Feb 2024 15:17:28 +0100 Subject: [PATCH 3/3] simplify readme --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index ce0f155..fd00aeb 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Use Node.js LTS - uses: actions/setup-node@v3 - with: - node-version: '16' - name: Add React Admin Enterprise Edition CI token uses: react-admin/ra-enterprise-action@1.0.0 env: