From 68d4f6cb08381dc5953711fb49da7b35ee1ae614 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 14:35:58 -0700 Subject: [PATCH 01/29] Fixing CI tests --- .github/workflows/npm_ci_tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/npm_ci_tests.yml b/.github/workflows/npm_ci_tests.yml index 1bd9ec91..2fae3a34 100644 --- a/.github/workflows/npm_ci_tests.yml +++ b/.github/workflows/npm_ci_tests.yml @@ -35,6 +35,10 @@ on: jobs: build: runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./codex-vscode strategy: matrix: node-version: [lts/gallium] From f6fd0bdbb72d50a489cb5b276c9cf70910606908 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 14:48:15 -0700 Subject: [PATCH 02/29] Adding as build step instead --- .github/workflows/npm_build_and_package_alpha.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index d0876a6f..62d8dab8 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -7,13 +7,7 @@ on: - development jobs: - build-webview: - uses: ./.github/workflows/npm_build_webview.yml - secrets: - READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - build: - needs: build-webview runs-on: ubuntu-latest defaults: run: @@ -45,6 +39,12 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "npm" + + - name: Build webview + uses: ./.github/workflows/npm_build_webview.yml + with: + secrets: + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Install dependencies run: npm ci --include=dev From ad4e0aa8b2253b4670db0418597da40c86368dc6 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 14:49:14 -0700 Subject: [PATCH 03/29] Secrets instead --- .github/workflows/npm_build_and_package_alpha.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 62d8dab8..0e5fc5eb 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -42,9 +42,8 @@ jobs: - name: Build webview uses: ./.github/workflows/npm_build_webview.yml - with: - secrets: - READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + secrets: + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Install dependencies run: npm ci --include=dev From 93d857675d6a542b2a922772778135821ac55c6e Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 14:49:55 -0700 Subject: [PATCH 04/29] Env? --- .github/workflows/npm_build_and_package_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 0e5fc5eb..d97be1fb 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -42,7 +42,7 @@ jobs: - name: Build webview uses: ./.github/workflows/npm_build_webview.yml - secrets: + env: READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Install dependencies From 56da091f8e401195d16051594a43a739da65d00c Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:13:57 -0700 Subject: [PATCH 05/29] Deleting seperate workflow, adding steps into alpha package workflow --- .../workflows/npm_build_and_package_alpha.yml | 22 +++++++----- .github/workflows/npm_build_webview.yml | 36 ------------------- 2 files changed, 14 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/npm_build_webview.yml diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index d97be1fb..eab97f94 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -39,14 +39,23 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "npm" + + - name: Install global packages + run: npm i -g vsce rollup webpack yarn - - name: Build webview - uses: ./.github/workflows/npm_build_webview.yml - env: - READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + - name: Install dependencies for codex-webview + run: npm ci --include=dev + working-directory: ./codex-webview + env: + GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + + - name: Build webview + working-directory: ./codex-webview + run: npm run build - - name: Install dependencies + - name: Install dependencies for codex-vscode run: npm ci --include=dev + working-directory: ./codex-vscode env: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} @@ -62,9 +71,6 @@ jobs: - name: Bump patch version to alpha run: npm version prerelease --preid="alpha-${SHORT_SHA}" - - name: Install global packages - run: npm i -g vsce rollup webpack yarn - - name: Get version id: package-version run: echo ::set-output name=current-version::$(node -p -e "require('./package.json').version") diff --git a/.github/workflows/npm_build_webview.yml b/.github/workflows/npm_build_webview.yml deleted file mode 100644 index ef770a1b..00000000 --- a/.github/workflows/npm_build_webview.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: - workflow_call: - secrets: - READ_PACKAGES_TOKEN: - required: true - -jobs: - build-webview: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ./codex-webview - permissions: - contents: read - packages: write - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: "npm" - - - name: Install dependencies - run: npm ci --include=dev - env: - GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - - - name: Install global packages - run: npm i -g rollup - - - name: Build webview - run: npm run build \ No newline at end of file From c8e002c9e64df81d9b1fd37855e017534becf665 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:15:56 -0700 Subject: [PATCH 06/29] Fixing syntax, adding working dir --- .github/workflows/npm_build_and_package_alpha.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index eab97f94..175744a2 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -9,10 +9,6 @@ on: jobs: build: runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: ./codex-vscode env: NODE_ENV: ${{ secrets.NODE_ENV }} FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} @@ -41,7 +37,7 @@ jobs: cache: "npm" - name: Install global packages - run: npm i -g vsce rollup webpack yarn + run: npm i -g vsce rollup webpack yarn - name: Install dependencies for codex-webview run: npm ci --include=dev @@ -60,23 +56,28 @@ jobs: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Configure git author + working-directory: ./codex-vscode run: | git --version git config user.name "GitHub Actions Bot" git config user.email "<>" - name: Add SHORT_SHA env property with commit short sha + working-directory: ./codex-vscode run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - name: Bump patch version to alpha + working-directory: ./codex-vscode run: npm version prerelease --preid="alpha-${SHORT_SHA}" - name: Get version + working-directory: ./codex-vscode id: package-version run: echo ::set-output name=current-version::$(node -p -e "require('./package.json').version") - name: Build package run: npm run package:staging + working-directory: ./codex-vscode env: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} From 925b3762625e0eb8af8e2e7259c892205eacdd9d Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:17:02 -0700 Subject: [PATCH 07/29] fixing more sytnax errors --- .github/workflows/npm_build_and_package_alpha.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 175744a2..f59bd4d6 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -40,14 +40,14 @@ jobs: run: npm i -g vsce rollup webpack yarn - name: Install dependencies for codex-webview - run: npm ci --include=dev - working-directory: ./codex-webview - env: - GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + run: npm ci --include=dev + working-directory: ./codex-webview + env: + GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - - name: Build webview - working-directory: ./codex-webview - run: npm run build + - name: Build webview + working-directory: ./codex-webview + run: npm run build - name: Install dependencies for codex-vscode run: npm ci --include=dev From f8b2573767ef50a1791b222487e454ebe87ae031 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:25:22 -0700 Subject: [PATCH 08/29] Adding workdir --- .github/workflows/npm_build_and_package_alpha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index f59bd4d6..f624c7d8 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -83,6 +83,7 @@ jobs: - name: Upload vsix as artifact uses: actions/upload-artifact@v1 + working-directory: ./codex-vscode with: name: codex-${{steps.package-version.outputs.current-version}}.vsix path: ${{github.workspace}}/codex-build-${{steps.package-version.outputs.current-version}}.vsix From ff54ce42cdbfce8da191f42427cdc721921b0ce3 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:28:09 -0700 Subject: [PATCH 09/29] build staging at root --- .github/workflows/npm_build_and_package_alpha.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index f624c7d8..79b63529 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -44,10 +44,6 @@ jobs: working-directory: ./codex-webview env: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - - - name: Build webview - working-directory: ./codex-webview - run: npm run build - name: Install dependencies for codex-vscode run: npm ci --include=dev @@ -77,13 +73,11 @@ jobs: - name: Build package run: npm run package:staging - working-directory: ./codex-vscode env: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Upload vsix as artifact uses: actions/upload-artifact@v1 - working-directory: ./codex-vscode with: name: codex-${{steps.package-version.outputs.current-version}}.vsix path: ${{github.workspace}}/codex-build-${{steps.package-version.outputs.current-version}}.vsix From f673b803f12bd519180181d0e6f12fd40e0b5a83 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:34:32 -0700 Subject: [PATCH 10/29] Fixing path, one more nested folder deep --- .github/workflows/npm_build_and_package_alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 79b63529..3f83c2f1 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -80,7 +80,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: codex-${{steps.package-version.outputs.current-version}}.vsix - path: ${{github.workspace}}/codex-build-${{steps.package-version.outputs.current-version}}.vsix + path: ${{github.workspace}}/codex-vscode/codex-build-${{steps.package-version.outputs.current-version}}.vsix - name: Send Data back to slack id: slack From f2576ca4b4ded1b26f730293a68f756c4e368d4e Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:41:38 -0700 Subject: [PATCH 11/29] explicitly running tests for vscode --- .github/workflows/npm_ci_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm_ci_tests.yml b/.github/workflows/npm_ci_tests.yml index 2fae3a34..350daaa1 100644 --- a/.github/workflows/npm_ci_tests.yml +++ b/.github/workflows/npm_ci_tests.yml @@ -128,6 +128,6 @@ jobs: - name: Run unit tests uses: GabrielBB/xvfb-action@v1.5 with: - run: npm run test + run: cd ./codex-vscode && npm run test env: API_URL: ${{ secrets.API_URL }} From e8495963f80ed9a485799c39f49f2028b0303977 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:45:52 -0700 Subject: [PATCH 12/29] Making tests a dependent workflow --- .../workflows/npm_build_and_package_alpha.yml | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 3f83c2f1..a5dd8861 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -6,23 +6,27 @@ on: - 'releases/**' - development +env: + NODE_ENV: ${{ secrets.NODE_ENV }} + FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} + API_URL: ${{ secrets.API_URL }} + PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} + PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} + PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} + SENTRY_DNS: ${{ secrets.SENTRY_DNS }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + LOG_MAX_FILE_SIZE: 5242880 + LOG_MAX_FILES: 10 + LOG_LEVEL: "debug" + POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} + SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }} + jobs: + test: + uses: ./.github/workflows/npm_ci_tests.yml + build: runs-on: ubuntu-latest - env: - NODE_ENV: ${{ secrets.NODE_ENV }} - FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} - API_URL: ${{ secrets.API_URL }} - PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} - PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} - PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} - SENTRY_DNS: ${{ secrets.SENTRY_DNS }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - LOG_MAX_FILE_SIZE: 5242880 - LOG_MAX_FILES: 10 - LOG_LEVEL: "debug" - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }} permissions: contents: read packages: write From b6d1707a4b6b5a6f300939e957a06fc900fbd619 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:55:09 -0700 Subject: [PATCH 13/29] Cleaning up CI variables --- .../workflows/npm_build_and_package_alpha.yml | 3 +++ .github/workflows/npm_ci_tests.yml | 26 +------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index a5dd8861..1161dfde 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -24,6 +24,9 @@ env: jobs: test: uses: ./.github/workflows/npm_ci_tests.yml + secrets: + CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }} + CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} build: runs-on: ubuntu-latest diff --git a/.github/workflows/npm_ci_tests.yml b/.github/workflows/npm_ci_tests.yml index 350daaa1..0b55c10d 100644 --- a/.github/workflows/npm_ci_tests.yml +++ b/.github/workflows/npm_ci_tests.yml @@ -7,30 +7,6 @@ on: required: true CODEX_PUBLIC_KEY: required: true - NODE_ENV: - required: true - FORCE_CLIENT_CHECK: - required: true - API_URL: - required: true - PUSHER_AUTH_ENDPOINT: - required: true - PUSHER_APP_KEY: - required: true - PUSHER_CLUSTER: - required: true - SENTRY_DNS: - required: true - SENTRY_AUTH_TOKEN: - required: true - LOG_MAX_FILE_SIZE: - required: true - LOG_MAX_FILES: - required: true - POSTHOG_KEY: - required: true - SEGMENT_KEY: - required: true jobs: build: @@ -130,4 +106,4 @@ jobs: with: run: cd ./codex-vscode && npm run test env: - API_URL: ${{ secrets.API_URL }} + API_URL: http://localhost:3002/api From f7809c01bd6abf925b32eded954da50eba326050 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 15:56:38 -0700 Subject: [PATCH 14/29] making them run in series --- .github/workflows/npm_build_and_package_alpha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index 1161dfde..b4ffbf98 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -29,6 +29,7 @@ jobs: CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} build: + needs: test runs-on: ubuntu-latest permissions: contents: read From 05a1cdf2cd220d8bfb6fb57be38c629158598bc4 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:00:32 -0700 Subject: [PATCH 15/29] Test always runs first, passing in packages token --- .github/workflows/npm_build_and_package_alpha.yml | 1 + .github/workflows/npm_ci_tests.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm_build_and_package_alpha.yml b/.github/workflows/npm_build_and_package_alpha.yml index b4ffbf98..bc560f22 100644 --- a/.github/workflows/npm_build_and_package_alpha.yml +++ b/.github/workflows/npm_build_and_package_alpha.yml @@ -27,6 +27,7 @@ jobs: secrets: CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }} CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} build: needs: test diff --git a/.github/workflows/npm_ci_tests.yml b/.github/workflows/npm_ci_tests.yml index 0b55c10d..9a31b40e 100644 --- a/.github/workflows/npm_ci_tests.yml +++ b/.github/workflows/npm_ci_tests.yml @@ -1,12 +1,13 @@ name: Tests on: - push: workflow_call: secrets: CODEX_PRIVATE_KEY: required: true CODEX_PUBLIC_KEY: required: true + READ_PACKAGES_TOKEN: + required: true jobs: build: From 57d1d7ce1f4101f2a63031573dd57209478839eb Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:10:23 -0700 Subject: [PATCH 16/29] Updating other packaging workflow --- .github/workflows/npm_build_and_package.yml | 77 ++++++++++----------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/.github/workflows/npm_build_and_package.yml b/.github/workflows/npm_build_and_package.yml index fe8b9f69..2ac3b76e 100644 --- a/.github/workflows/npm_build_and_package.yml +++ b/.github/workflows/npm_build_and_package.yml @@ -6,47 +6,32 @@ on: - 'releases/**' - development +env: + NODE_ENV: ${{ secrets.NODE_ENV }} + FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} + API_URL: ${{ secrets.API_URL }} + PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} + PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} + PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} + SENTRY_DNS: ${{ secrets.SENTRY_DNS }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + LOG_MAX_FILE_SIZE: 5242880 + LOG_MAX_FILES: 10 + LOG_LEVEL: "debug" + POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} + SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }} + jobs: - # test: - # uses: ./.github/workflows/npm_ci_ui_tests.yml - # secrets: - # CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} - # CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }} - # NODE_ENV: ${{ secrets.NODE_ENV }} - # FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} - # API_URL: ${{ secrets.API_URL }} - # PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} - # PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} - # PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} - # SENTRY_DNS: ${{ secrets.SENTRY_DNS }} - # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - # LOG_MAX_FILE_SIZE: ${{ secrets.LOG_MAX_FILE_SIZE }} - # LOG_MAX_FILES: ${{ secrets.LOG_MAX_FILES }} - # POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - build-webview: - uses: ./.github/workflows/npm_build_webview.yml + test: + uses: ./.github/workflows/npm_ci_tests.yml + secrets: + CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }} + CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} build: + needs: test runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: [./codex-vscode] - needs: build-webview - env: - NODE_ENV: ${{ secrets.NODE_ENV }} - FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} - API_URL: ${{ secrets.API_URL }} - PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} - PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} - PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} - SENTRY_DNS: ${{ secrets.SENTRY_DNS }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - LOG_MAX_FILE_SIZE: 5242880 - LOG_MAX_FILES: 10 - LOG_LEVEL: "debug" - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }} permissions: contents: read packages: write @@ -59,9 +44,19 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "npm" + + - name: Install global packages + run: npm i -g vsce rollup webpack yarn - - name: Install dependencies + - name: Install dependencies for codex-webview run: npm ci --include=dev + working-directory: ./codex-webview + env: + GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + + - name: Install dependencies for codex-vscode + run: npm ci --include=dev + working-directory: ./codex-vscode env: GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} @@ -78,10 +73,8 @@ jobs: if: github.ref == 'refs/heads/development' run: npm version prerelease --preid="beta-${SHORT_SHA}" - - name: Install global packages - run: npm i -g vsce rollup webpack yarn - - name: Get version + working-directory: ./codex-vscode id: package-version run: echo ::set-output name=current-version::$(node -p -e "require('./package.json').version") @@ -94,7 +87,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: codex-${{steps.package-version.outputs.current-version}}.vsix - path: ${{github.workspace}}/codex-build-${{steps.package-version.outputs.current-version}}.vsix + path: ${{github.workspace}}/codex-vscode/codex-build-${{steps.package-version.outputs.current-version}}.vsix - name: Send Data back to slack id: slack From 95d521f62888182d9aa2122e568ed7e83729425a Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:25:44 -0700 Subject: [PATCH 17/29] Adding publishing webview workflow --- .github/workflows/npm_publish_webview.yml | 78 +++++++ codex-webview/package-lock.json | 4 +- codex-webview/package.json | 243 +++++++++++----------- 3 files changed, 202 insertions(+), 123 deletions(-) create mode 100644 .github/workflows/npm_publish_webview.yml diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml new file mode 100644 index 00000000..cc0f79a1 --- /dev/null +++ b/.github/workflows/npm_publish_webview.yml @@ -0,0 +1,78 @@ +name: Build and Package latest webview + +on: + push: + branches: + - derrick/cod-1272-ci-action-to-publish-js-bundle-artifact + - 'releases/**' + - development + +env: + NODE_ENV: ${{ secrets.NODE_ENV }} + FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} + API_URL: ${{ secrets.API_URL }} + PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }} + PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }} + PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }} + SENTRY_DNS: ${{ secrets.SENTRY_DNS }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + LOG_MAX_FILE_SIZE: 5242880 + LOG_MAX_FILES: 10 + LOG_LEVEL: "debug" + POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} + SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }} + +jobs: + test: + uses: ./.github/workflows/npm_ci_tests.yml + secrets: + CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }} + CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }} + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + + build: + needs: test + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - name: Install global packages + run: npm i -g rollup + + - name: Install dependencies + run: npm ci --include=dev + working-directory: ./codex-webview + env: + GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} + + - name: Configure git author + run: | + git --version + git config user.name "GitHub Actions Bot" + git config user.email "<>" + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + + - name: Bump patch version to alpha + working-directory: ./codex-webview + run: npm version prerelease --preid="alpha-${SHORT_SHA}" + + - name: Bump patch version to beta + if: github.ref == 'refs/heads/development' + working-directory: ./codex-webview + run: npm version prerelease --preid="beta-${SHORT_SHA}" + + - name: Publish + working-directory: ./codex-webview + run: npm publish diff --git a/codex-webview/package-lock.json b/codex-webview/package-lock.json index 463a3ee0..4ded8022 100644 --- a/codex-webview/package-lock.json +++ b/codex-webview/package-lock.json @@ -1,12 +1,12 @@ { "name": "@usecodex/codex-webview", - "version": "0.1.0", + "version": "0.1.1-beta-blah.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@usecodex/codex-webview", - "version": "0.1.0", + "version": "0.1.1-beta-blah.0", "license": "UNLICENSED", "dependencies": { "@sentry/node": "^6.11.0", diff --git a/codex-webview/package.json b/codex-webview/package.json index 357e2f99..a0eb04b8 100644 --- a/codex-webview/package.json +++ b/codex-webview/package.json @@ -1,6 +1,6 @@ { "name": "@usecodex/codex-webview", - "version": "0.1.0", + "version": "0.1.1-beta-blah.0", "description": "This is the codex webview for our extensions.", "author": "Codex Build Inc.", "license": "UNLICENSED", @@ -8,131 +8,132 @@ "watch": "rollup -c -w", "build:css": "tailwind build -i media/style.css -o out/style.css", "build": "npm run build:css && rollup -c", - "test": "echo \"Error: TODO: Set up unit tests\" && exit 1" + "test": "echo \"Error: TODO: Set up unit tests\" && exit 1", + "prepublish": "npm run build" }, "files": [ - "out" + "out" ], "publishConfig": { "registry": "https://npm.pkg.github.com" }, "keywords": [], - "devDependencies": { - "@fullhuman/postcss-purgecss": "^4.0.3", - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-image": "^2.1.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^11.2.1", - "@rollup/plugin-typescript": "^8.2.1", - "@sentry/webpack-plugin": "^1.18.7", - "@tailwindcss/forms": "^0.3.3", - "@tailwindcss/line-clamp": "^0.2.1", - "@tsconfig/svelte": "^1.0.10", - "@types/analytics-node": "^3.1.9", - "@types/chai": "^4.3.0", - "@types/diff": "^5.0.1", - "@types/eslint": "^8.4.3", - "@types/estree": "^0.0.51", - "@types/expect": "^24.3.0", - "@types/fs-extra": "^9.0.13", - "@types/git-url-parse": "^9.0.1", - "@types/glob": "^7.1.3", - "@types/lodash-es": "^4.17.5", - "@types/markdown-it": "^12.2.3", - "@types/markdown-it-attrs": "^4.1.0", - "@types/mocha": "^8.2.3", - "@types/moment-timezone": "^0.5.30", - "@types/node": "^17.0.15", - "@types/qs": "^6.9.6", - "@types/random-words": "^1.1.2", - "@types/selenium-webdriver": "^4.0.18", - "@types/set-interval-async": "^1.0.0", - "@types/sinon": "^10.0.11", - "@types/sinon-chai": "^3.2.8", - "@types/uuid": "^8.3.4", - "@types/vscode": "^1.55.0", - "@types/winston": "^2.4.4", - "@typescript-eslint/eslint-plugin": "^4.14.1", - "@typescript-eslint/parser": "^4.14.1", - "@vscode/test-electron": "^2.1.2", - "at-least-node": "^1.0.0", - "autoprefixer": "^10.3.1", - "chai": "^4.3.6", - "concurrently": "^6.0.2", - "copy-webpack-plugin": "^9.1.0", - "dotenv": "^10.0.0", - "eslint": "^7.19.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0", - "fs-extra": "^10.0.0", - "glob": "^7.1.6", - "husky": "^7.0.4", - "mocha": "^8.4.0", - "node-sass": "^7.0.1", - "postcss": "^8.3.6", - "postcss-functions": "^4.0.2", - "prettier": "^2.3.2", - "random-words": "^1.1.2", - "rollup": "^2.3.4", - "rollup-plugin-node-builtins": "^2.1.2", - "rollup-plugin-polyfill-node": "^0.9.0", - "rollup-plugin-postcss": "^4.0.1", - "rollup-plugin-svelte": "^6.0.0", - "rollup-plugin-terser": "^7.0.2", - "sinon": "^13.0.1", - "sinon-chai": "^3.7.0", - "svelte": "^3.37.0", - "svelte-check": "^1.5.2", - "svelte-preprocess": "^4.7.2", - "tailwindcss": "^2.2.7", - "ts-loader": "^8.0.14", - "ts-mocha": "^9.0.2", - "ts-mockito": "^2.6.1", - "typescript": "^4.2.4", - "vscode-extension-tester": "^4.2.4", - "vscode-test": "^1.5.0", - "webpack": "^5.19.0", - "webpack-cli": "^4.4.0", - "webpack-node-externals": "^3.0.0" - }, - "dependencies": { - "@sentry/node": "^6.11.0", - "@sentry/tracing": "^6.11.0", - "@usecodex/common-library": "1.4.1-beta-95e2006b.0", - "@usecodex/prompt-ui-core": "0.0.1-beta-5ce420ed.0", - "@usecodex/prompt-ui-svelte": "0.0.1-beta-5ce420ed.0", - "analytics-node": "^6.0.0", - "axios": "^0.21.4", - "git-url-parse": "^11.5.0", - "highlight.js": "^11.3.1", - "immer": "^9.0.12", - "indent-textarea": "^2.1.0", - "joi": "^17.4.2", - "lodash-es": "^4.17.21", - "markdown-it": "^12.1.0", - "markdown-it-attrs": "^4.1.3", - "markdown-it-bracketed-spans": "^1.0.1", - "mkdirp": "^0.5.5", - "moment": "^2.29.1", - "moment-timezone": "^0.5.33", - "parse-diff": "^0.8.1", - "parse-github-url": "^1.0.2", - "posthog-js": "^1.16.4", - "posthog-node": "^1.2.0", - "pusher-js": "^7.0.3", - "qs": "^6.10.1", - "set-interval-async": "^2.0.3", - "simple-git": "^2.38.0", - "slugify": "^1.5.3", - "source-map-js": "^0.6.2", - "svelte-bootstrap-icons": "^1.5.1", - "svelte-navigator": "^3.1.5", - "svelte-routing": "^1.6.0", - "tabler-icons-svelte": "^1.7.0", - "tippy.js": "^6.3.7", - "uuid": "^8.3.2", - "winston": "^3.3.3", - "winston-transport": "^4.4.0", - "winston-transport-sentry-node": "^2.1.0" - } + "devDependencies": { + "@fullhuman/postcss-purgecss": "^4.0.3", + "@rollup/plugin-commonjs": "^18.0.0", + "@rollup/plugin-image": "^2.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^11.2.1", + "@rollup/plugin-typescript": "^8.2.1", + "@sentry/webpack-plugin": "^1.18.7", + "@tailwindcss/forms": "^0.3.3", + "@tailwindcss/line-clamp": "^0.2.1", + "@tsconfig/svelte": "^1.0.10", + "@types/analytics-node": "^3.1.9", + "@types/chai": "^4.3.0", + "@types/diff": "^5.0.1", + "@types/eslint": "^8.4.3", + "@types/estree": "^0.0.51", + "@types/expect": "^24.3.0", + "@types/fs-extra": "^9.0.13", + "@types/git-url-parse": "^9.0.1", + "@types/glob": "^7.1.3", + "@types/lodash-es": "^4.17.5", + "@types/markdown-it": "^12.2.3", + "@types/markdown-it-attrs": "^4.1.0", + "@types/mocha": "^8.2.3", + "@types/moment-timezone": "^0.5.30", + "@types/node": "^17.0.15", + "@types/qs": "^6.9.6", + "@types/random-words": "^1.1.2", + "@types/selenium-webdriver": "^4.0.18", + "@types/set-interval-async": "^1.0.0", + "@types/sinon": "^10.0.11", + "@types/sinon-chai": "^3.2.8", + "@types/uuid": "^8.3.4", + "@types/vscode": "^1.55.0", + "@types/winston": "^2.4.4", + "@typescript-eslint/eslint-plugin": "^4.14.1", + "@typescript-eslint/parser": "^4.14.1", + "@vscode/test-electron": "^2.1.2", + "at-least-node": "^1.0.0", + "autoprefixer": "^10.3.1", + "chai": "^4.3.6", + "concurrently": "^6.0.2", + "copy-webpack-plugin": "^9.1.0", + "dotenv": "^10.0.0", + "eslint": "^7.19.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "fs-extra": "^10.0.0", + "glob": "^7.1.6", + "husky": "^7.0.4", + "mocha": "^8.4.0", + "node-sass": "^7.0.1", + "postcss": "^8.3.6", + "postcss-functions": "^4.0.2", + "prettier": "^2.3.2", + "random-words": "^1.1.2", + "rollup": "^2.3.4", + "rollup-plugin-node-builtins": "^2.1.2", + "rollup-plugin-polyfill-node": "^0.9.0", + "rollup-plugin-postcss": "^4.0.1", + "rollup-plugin-svelte": "^6.0.0", + "rollup-plugin-terser": "^7.0.2", + "sinon": "^13.0.1", + "sinon-chai": "^3.7.0", + "svelte": "^3.37.0", + "svelte-check": "^1.5.2", + "svelte-preprocess": "^4.7.2", + "tailwindcss": "^2.2.7", + "ts-loader": "^8.0.14", + "ts-mocha": "^9.0.2", + "ts-mockito": "^2.6.1", + "typescript": "^4.2.4", + "vscode-extension-tester": "^4.2.4", + "vscode-test": "^1.5.0", + "webpack": "^5.19.0", + "webpack-cli": "^4.4.0", + "webpack-node-externals": "^3.0.0" + }, + "dependencies": { + "@sentry/node": "^6.11.0", + "@sentry/tracing": "^6.11.0", + "@usecodex/common-library": "1.4.1-beta-95e2006b.0", + "@usecodex/prompt-ui-core": "0.0.1-beta-5ce420ed.0", + "@usecodex/prompt-ui-svelte": "0.0.1-beta-5ce420ed.0", + "analytics-node": "^6.0.0", + "axios": "^0.21.4", + "git-url-parse": "^11.5.0", + "highlight.js": "^11.3.1", + "immer": "^9.0.12", + "indent-textarea": "^2.1.0", + "joi": "^17.4.2", + "lodash-es": "^4.17.21", + "markdown-it": "^12.1.0", + "markdown-it-attrs": "^4.1.3", + "markdown-it-bracketed-spans": "^1.0.1", + "mkdirp": "^0.5.5", + "moment": "^2.29.1", + "moment-timezone": "^0.5.33", + "parse-diff": "^0.8.1", + "parse-github-url": "^1.0.2", + "posthog-js": "^1.16.4", + "posthog-node": "^1.2.0", + "pusher-js": "^7.0.3", + "qs": "^6.10.1", + "set-interval-async": "^2.0.3", + "simple-git": "^2.38.0", + "slugify": "^1.5.3", + "source-map-js": "^0.6.2", + "svelte-bootstrap-icons": "^1.5.1", + "svelte-navigator": "^3.1.5", + "svelte-routing": "^1.6.0", + "tabler-icons-svelte": "^1.7.0", + "tippy.js": "^6.3.7", + "uuid": "^8.3.2", + "winston": "^3.3.3", + "winston-transport": "^4.4.0", + "winston-transport-sentry-node": "^2.1.0" + } } From dab294cf99d900a3e5c0bf6f9a652674a68f467d Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:33:20 -0700 Subject: [PATCH 18/29] Adding specific checkout for packages --- .github/workflows/npm_publish_webview.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index cc0f79a1..44459468 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -37,8 +37,12 @@ jobs: contents: read packages: write steps: - - name: Checkout sources - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to GitHub Packages + - uses: actions/setup-node@v2 + with: + node-version: '16.x' + registry-url: 'https://npm.pkg.github.com' - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 From a25370abf3ac2db921e07cba11f8f40cfab1be53 Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:39:44 -0700 Subject: [PATCH 19/29] Reseting version --- codex-webview/package-lock.json | 2 +- codex-webview/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-webview/package-lock.json b/codex-webview/package-lock.json index 4ded8022..277e28f3 100644 --- a/codex-webview/package-lock.json +++ b/codex-webview/package-lock.json @@ -1,6 +1,6 @@ { "name": "@usecodex/codex-webview", - "version": "0.1.1-beta-blah.0", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/codex-webview/package.json b/codex-webview/package.json index a0eb04b8..8ec26aa9 100644 --- a/codex-webview/package.json +++ b/codex-webview/package.json @@ -1,6 +1,6 @@ { "name": "@usecodex/codex-webview", - "version": "0.1.1-beta-blah.0", + "version": "0.1.0", "description": "This is the codex webview for our extensions.", "author": "Codex Build Inc.", "license": "UNLICENSED", From c6d0a18fbf4f7b56e84f06bf27ab23c387635eaf Mon Sep 17 00:00:00 2001 From: Derrick Date: Wed, 13 Jul 2022 16:46:34 -0700 Subject: [PATCH 20/29] Adding crucial information about repository to package.json to publish correctly --- codex-webview/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codex-webview/package.json b/codex-webview/package.json index 8ec26aa9..5c9c4445 100644 --- a/codex-webview/package.json +++ b/codex-webview/package.json @@ -17,6 +17,10 @@ "publishConfig": { "registry": "https://npm.pkg.github.com" }, + "repository": { + "type": "git", + "url": "git+https://github.com/usecodex/codex-vscode.git" + }, "keywords": [], "devDependencies": { "@fullhuman/postcss-purgecss": "^4.0.3", From 07a6135f6bb9cc38731b89dc2a8f9ce5d3ec0075 Mon Sep 17 00:00:00 2001 From: Derrick Date: Thu, 14 Jul 2022 17:01:39 -0700 Subject: [PATCH 21/29] Adding NODE_AUTH_TOKEN --- .github/workflows/npm_publish_webview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index 44459468..cae3f2a6 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -8,6 +8,7 @@ on: - development env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_ENV: ${{ secrets.NODE_ENV }} FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} API_URL: ${{ secrets.API_URL }} From 8feb0d9c7ce1e6b2dd588c91bb6749d5d93e345f Mon Sep 17 00:00:00 2001 From: Derrick Date: Fri, 15 Jul 2022 16:39:43 -0700 Subject: [PATCH 22/29] Removing redundant step --- .github/workflows/npm_publish_webview.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index cae3f2a6..33aac1bf 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -8,7 +8,6 @@ on: - development env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_ENV: ${{ secrets.NODE_ENV }} FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }} API_URL: ${{ secrets.API_URL }} @@ -32,6 +31,8 @@ jobs: READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} build: + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: test runs-on: ubuntu-latest permissions: @@ -44,12 +45,6 @@ jobs: with: node-version: '16.x' registry-url: 'https://npm.pkg.github.com' - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: "npm" - name: Install global packages run: npm i -g rollup From fa2f19dc1f0f64f16671410f6a2a6577c2617640 Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 11:00:00 -0700 Subject: [PATCH 23/29] Not re-setting GITHUB TOKEN --- .github/workflows/npm_publish_webview.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index 33aac1bf..075e44a6 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -52,8 +52,6 @@ jobs: - name: Install dependencies run: npm ci --include=dev working-directory: ./codex-webview - env: - GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Configure git author run: | From 0638f424718b196dcdf654bf69df554973421a24 Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 11:07:40 -0700 Subject: [PATCH 24/29] Setting GITHUB TOKEN --- .github/workflows/npm_publish_webview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index 075e44a6..c48f257c 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -52,6 +52,8 @@ jobs: - name: Install dependencies run: npm ci --include=dev working-directory: ./codex-webview + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Configure git author run: | From ff5f6631f64f8296022e5820e433e4c84ddcdf19 Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 11:22:32 -0700 Subject: [PATCH 25/29] Updating package lock --- codex-webview/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-webview/package-lock.json b/codex-webview/package-lock.json index 7873cdee..f0649814 100644 --- a/codex-webview/package-lock.json +++ b/codex-webview/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@usecodex/codex-webview", - "version": "0.1.1-beta-blah.0", + "version": "0.1.0", "license": "UNLICENSED", "dependencies": { "@sentry/node": "^6.11.0", From 55e1c75e10ba4f75e1cd2215442f16ac66fefa9f Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 11:36:42 -0700 Subject: [PATCH 26/29] Readding back the read packages token --- .github/workflows/npm_publish_webview.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index c48f257c..2b68d7cd 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -53,7 +53,7 @@ jobs: run: npm ci --include=dev working-directory: ./codex-webview env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} - name: Configure git author run: | @@ -76,3 +76,5 @@ jobs: - name: Publish working-directory: ./codex-webview run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 98d46c8ae90585f664b934e8bb0dc3f68632f924 Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 11:47:28 -0700 Subject: [PATCH 27/29] Using PAT instead --- .github/workflows/npm_publish_webview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index 2b68d7cd..54c489b9 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -32,7 +32,7 @@ jobs: build: env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} needs: test runs-on: ubuntu-latest permissions: @@ -77,4 +77,4 @@ jobs: working-directory: ./codex-webview run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} From 73e4c286c4e21c7e23e20eb75850b928cce704fe Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 13:28:56 -0700 Subject: [PATCH 28/29] Adding scope --- .github/workflows/npm_publish_webview.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/npm_publish_webview.yml b/.github/workflows/npm_publish_webview.yml index 54c489b9..3e8053b9 100644 --- a/.github/workflows/npm_publish_webview.yml +++ b/.github/workflows/npm_publish_webview.yml @@ -45,6 +45,7 @@ jobs: with: node-version: '16.x' registry-url: 'https://npm.pkg.github.com' + scope: "@usecodex" - name: Install global packages run: npm i -g rollup @@ -76,5 +77,3 @@ jobs: - name: Publish working-directory: ./codex-webview run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} From dc5fc507aff0385587e2d3404e998a19b0b2e387 Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 18 Jul 2022 13:36:02 -0700 Subject: [PATCH 29/29] Removing slash --- codex-webview/.npmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-webview/.npmrc b/codex-webview/.npmrc index a0a68a8a..b8d26615 100644 --- a/codex-webview/.npmrc +++ b/codex-webview/.npmrc @@ -1,2 +1,2 @@ @usecodex:registry=https://npm.pkg.github.com/ -//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} +//npm.pkg.github.com:_authToken=${GITHUB_TOKEN}