From 9caf0095793df8744bc704731f7bf05a271ac9af Mon Sep 17 00:00:00 2001 From: Rouel Joseph Soberano Date: Wed, 6 Dec 2023 14:59:20 -0800 Subject: [PATCH] Breaking out npm install into action --- .github/workflows/manual-publish.yml | 4 +-- .github/workflows/release-please.yml | 44 +++++++-------------------- actions/install-latest-npm/action.yml | 8 +++++ 3 files changed, 20 insertions(+), 36 deletions(-) create mode 100644 actions/install-latest-npm/action.yml diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 572cb9006..594ea7b2b 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -41,9 +41,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - name: 'Setup Redis' if: ${{ inputs.workspace_path == 'packages/store/node-server-sdk-redis' }} run: | diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 7492228aa..f1bdad16f 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -40,9 +40,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/shared/common uses: ./actions/full-release @@ -63,9 +61,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/shared/sdk-server uses: ./actions/full-release @@ -86,9 +82,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/shared/sdk-server-edge uses: ./actions/full-release @@ -109,9 +103,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/shared/akamai-edgeworker-sdk uses: ./actions/full-release @@ -132,9 +124,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/sdk/cloudflare uses: ./actions/full-release @@ -155,9 +145,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/sdk/server-node uses: ./actions/full-release @@ -178,9 +166,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/sdk/vercel uses: ./actions/full-release @@ -201,9 +187,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/sdk/akamai-base uses: ./actions/full-release @@ -224,9 +208,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - id: release-common name: Full release of packages/sdk/akamai-edgekv uses: ./actions/full-release @@ -247,9 +229,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - run: | sudo apt-get update sudo apt-get install redis-server @@ -274,9 +254,7 @@ jobs: with: node-version: 16.x registry-url: 'https://registry.npmjs.org' - - name: 'Install latest npm to support provenance publishing' - run: | - npm install -g npm + - uses: ./actions/install-latest-npm - run: | sudo docker run -d -p 8000:8000 amazon/dynamodb-local - id: release-common diff --git a/actions/install-latest-npm/action.yml b/actions/install-latest-npm/action.yml new file mode 100644 index 000000000..13f789906 --- /dev/null +++ b/actions/install-latest-npm/action.yml @@ -0,0 +1,8 @@ +name: Install latest npm +description: Install the latest version of the npm CLI utility +runs: + using: composite + steps: + - name: 'Install latest npm to support provenance publishing' + run: | + npm install -g npm \ No newline at end of file