From f45662a56ae95fd79352aa95cbb73b564bb2e19b Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 10:07:49 -0600 Subject: [PATCH 1/6] ci: update Node version to 18 (#74) * ci: replaced GH action to deploy page * fix: changed Node version to 18 --------- Co-authored-by: Jordy Herrera Mussio --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy_cdn.yml | 7 +++++-- .github/workflows/docs.yml | 10 +++++++++- .github/workflows/npm_upload.yml | 7 +++++-- .github/workflows/release.yml | 8 ++++++++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a530f9..ff8e4b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [18] + node: [ 18 ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/deploy_cdn.yml b/.github/workflows/deploy_cdn.yml index 9fcb890..008e28e 100644 --- a/.github/workflows/deploy_cdn.yml +++ b/.github/workflows/deploy_cdn.yml @@ -8,6 +8,9 @@ on: jobs: Deploy: runs-on: ubuntu-latest + strategy: + matrix: + node: [ 18 ] env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -15,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Node.js + - name: Setup Node.js ${{ matrix.node }} uses: actions/setup-node@v2 with: - node-version: 14 + node-version: ${{ matrix.node }} - name: Install dependencies run: npm ci diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ccd40ed..e58163b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,9 +8,17 @@ on: jobs: Documentation: runs-on: ubuntu-latest + strategy: + matrix: + node: [ 18 ] steps: - uses: actions/checkout@v2 + - name: Setup Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies run: | npm ci @@ -21,7 +29,7 @@ jobs: npm run docs - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.2.2 + uses: github/pages-deploy-action@v2 with: branch: gh-pages folder: dist/docs diff --git a/.github/workflows/npm_upload.yml b/.github/workflows/npm_upload.yml index 9ff9b43..9c4231a 100644 --- a/.github/workflows/npm_upload.yml +++ b/.github/workflows/npm_upload.yml @@ -8,13 +8,16 @@ on: jobs: Publish: runs-on: ubuntu-latest + strategy: + matrix: + node: [ 18 ] steps: - uses: actions/checkout@v2 - - name: Setup Node.js + - name: Setup Node.js ${{ matrix.node }} uses: actions/setup-node@v2 with: - node-version: 14 + node-version: ${{ matrix.node }} - name: Install dependencies run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37acacd..fc86eab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,9 @@ on: jobs: Release: runs-on: ubuntu-latest + strategy: + matrix: + node: [ 18 ] env: RELEASE_VERSION: ${{ github.event.inputs.version }} steps: @@ -22,6 +25,11 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com + - name: Setup Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Bump version run: | npm run release -- --release-as ${{ env.RELEASE_VERSION }} --no-verify --skip.changelog From 6483d8f6415489251c2e55f9c83b01ee070e839b Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 11:22:06 -0600 Subject: [PATCH 2/6] ci: change docs deployment action (#75) --- .github/workflows/docs.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e58163b..7da1bbd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,9 +27,22 @@ jobs: run: | npm run build npm run docs + Deploy: + needs: Documentation - - name: Deploy - uses: github/pages-deploy-action@v2 + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 with: - branch: gh-pages - folder: dist/docs + path: dist/docs From b1dccdea3618ee7821bdb2ee7e1d0227c285acea Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 12:53:19 -0600 Subject: [PATCH 3/6] fix: add upload artifact step (#76) --- .github/workflows/docs.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7da1bbd..fd0326d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,6 +27,13 @@ jobs: run: | npm run build npm run docs + + - name: Upload artifact + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: github-pages + path: dist/docs Deploy: needs: Documentation @@ -44,5 +51,3 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 - with: - path: dist/docs From 410909dbe1d90470af0a8b9a54f59a7bc3995aa1 Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 16:32:43 -0600 Subject: [PATCH 4/6] ci: fix docs deployment (#77) * fix: using docs deploy defaults * fix: temporarily changed to any branch * fix: added upload artifact again * fix: added missing permissions * fix: changed upload action to upload-pages-artifact * fix: added missing environment * fix: added missing upload-pages-artifact version * fix: moved deploy runs-on before steps * fix: changed upload-pages-artifact to use v3 * fix: added checkout for gh-pages branch * fix: reverted on push tags to v* --------- Co-authored-by: Jordy Herrera Mussio --- .github/workflows/docs.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fd0326d..378544d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: matrix: node: [ 18 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node }} uses: actions/setup-node@v2 @@ -28,25 +28,19 @@ jobs: npm run build npm run docs - - name: Upload artifact - id: upload-artifact - uses: actions/upload-artifact@v4 + - name: Upload Pages Artifact + uses: actions/upload-pages-artifact@v3 with: - name: github-pages path: dist/docs Deploy: needs: Documentation - + runs-on: ubuntu-latest permissions: pages: write id-token: write - environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: - name: Deploy to GitHub Pages id: deployment From 2848502c38fa7143f2a5f3d0237a6ce24ad80ceb Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 18:33:35 -0600 Subject: [PATCH 5/6] ci: change invalidation path (#78) --- scripts/deploy-cdn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/deploy-cdn.js b/scripts/deploy-cdn.js index e6b8f90..1762768 100644 --- a/scripts/deploy-cdn.js +++ b/scripts/deploy-cdn.js @@ -6,6 +6,6 @@ const bucketPath = `${bucketName}/${packageName}/${tagName}`; // Sync to s3 and invalidate const syncCommand = `aws s3 sync . s3://${bucketPath} --delete --acl public-read` -const invalidationCommand = `aws cloudfront create-invalidation --distribution-id ${distId} --paths ${bucketPath}/*` +const invalidationCommand = `aws cloudfront create-invalidation --distribution-id ${distId} --paths /${packageName}/${tagName}/*` execSync(syncCommand, { stdio: 'inherit', cwd: folder }); execSync(invalidationCommand, { stdio: 'inherit', cwd: folder }); From 606f2de250a6dc0950242b4f4d9982ccbfae1123 Mon Sep 17 00:00:00 2001 From: Jordy Herrera Mussio Date: Mon, 29 Jul 2024 18:33:56 -0600 Subject: [PATCH 6/6] chore: update GH actions to latest (#79) --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 14 +++++++------- .github/workflows/deploy_cdn.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/npm_upload.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- .github/workflows/whitesource.yml | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff8e4b2..a055484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,10 @@ jobs: matrix: node: [ 18 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 793b8a0..75fe148 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,30 +38,30 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. - + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # If the Autobuild fails above, remove it and uncomment the following three lines. + # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # - run: | @@ -69,4 +69,4 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/deploy_cdn.yml b/.github/workflows/deploy_cdn.yml index 008e28e..8acf38b 100644 --- a/.github/workflows/deploy_cdn.yml +++ b/.github/workflows/deploy_cdn.yml @@ -16,10 +16,10 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} PACKAGE_NAME: '@ibm-aspera/connect-sdk-js' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -30,7 +30,7 @@ jobs: run: npm run build - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.12' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 378544d..c04255c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/npm_upload.yml b/.github/workflows/npm_upload.yml index 9c4231a..fc4c88d 100644 --- a/.github/workflows/npm_upload.yml +++ b/.github/workflows/npm_upload.yml @@ -12,10 +12,10 @@ jobs: matrix: node: [ 18 ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -28,7 +28,7 @@ jobs: npm run build - name: Publish - uses: JS-DevTools/npm-publish@v1 + uses: JS-DevTools/npm-publish@v3 with: access: public token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc86eab..69f7339 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: env: RELEASE_VERSION: ${{ github.event.inputs.version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: token: ${{ secrets.GH_PAT }} # Needed to properly trigger workflow events @@ -26,7 +26,7 @@ jobs: git config user.email github-actions@github.com - name: Setup Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/whitesource.yml b/.github/workflows/whitesource.yml index de0f3fc..f6c79a1 100644 --- a/.github/workflows/whitesource.yml +++ b/.github/workflows/whitesource.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run Whitesource Action uses: TheAxZim/Whitesource-Scan-Action@v1.0.0