From 6621e920c4c7a524d5a324411d904cfb81e581e4 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 2 Jul 2024 23:26:43 -0400 Subject: [PATCH 1/4] npm deploy --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a9e9ea8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +iname: Release +on: + # manual trigger + workflow_dispatch: + +jobs: + deploy: + name: release + runs-on: + group: npm-deploy + environment: + name: release + steps: + - name: Load secret + uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 + with: + # Export loaded secrets as environment variables + export-env: true + env: + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + # You may need to change this to your vault name and secret name + # Refer to it by calling env.NPM_TOKEN + # This token is also limited by IP to ONLY work on the runner + NPM_TOKEN: op://npm-deploy/npm-runner-token/secret + + - name: Release + env: + NPM_CONFIG_USERCONFIG: /dev/null + NPM_TOKEN: ${{ env.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Optional + run: yarn g:release From 17eae6293f9e875218627471b835e63574ead4bd Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 2 Jul 2024 23:29:55 -0400 Subject: [PATCH 2/4] remove old release --- .github/workflows/release.yaml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index c922d48..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release - -on: - workflow_dispatch: # manually - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - - run: yarn test - if: success() - - - run: yarn release - if: success() - env: - NPM_CONFIG_USERCONFIG: /dev/null - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From ece2940a0ae222e376b839dfeabad2c3dce8cf78 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 2 Jul 2024 23:36:43 -0400 Subject: [PATCH 3/4] chore: remove typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9e9ea8..11de12b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -iname: Release +name: Release on: # manual trigger workflow_dispatch: From 974c6dbf2e99839ff07f315838c70677579bbf0b Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 3 Jul 2024 21:16:31 -0400 Subject: [PATCH 4/4] chore(infra): setup steps for npm deploy --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11de12b..5494df5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,18 @@ jobs: # Refer to it by calling env.NPM_TOKEN # This token is also limited by IP to ONLY work on the runner NPM_TOKEN: op://npm-deploy/npm-runner-token/secret + + - name: Checkout + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 + + - name: Setup Node + uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 + with: + cache: yarn + node-version: 18 + + - name: Install dependencies + run: yarn install --immutable --immutable-cache - name: Release env: @@ -29,3 +41,4 @@ jobs: NPM_TOKEN: ${{ env.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Optional run: yarn g:release +