From 1f614426dd3b6994a4494c0e26cef02a6b2c79b3 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 11:57:10 +0200 Subject: [PATCH 01/14] chore: make packages independent for lerna --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 37e0ed8..b936b66 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "0.2.0" + "version": "independent" } From a6d3c0ebfe96c8d11e5c86bbbfb0d78f8feb1360 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 15:28:47 +0200 Subject: [PATCH 02/14] chore: create github workflow --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ .nvmrc | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .nvmrc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7208cbf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish to npm + +on: pull_request + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: ${{ !env.ACT || '' }} # Disable cache for nektos/act + + - name: Install dependencies + run: yarn --immutable + # run: npm ci + + # - name: Bootstrap Lerna + # run: npx lerna bootstrap + - name: Publish to npm + run: npx lerna publish --no-private --yes + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..25bf17f --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18 \ No newline at end of file From 15f535437a1a5536186e2c19436778fcc6d5ffc0 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 15:52:53 +0200 Subject: [PATCH 03/14] fix: remove caching --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7208cbf..143dbcf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,6 @@ jobs: uses: actions/setup-node@v3 with: node-version-file: .nvmrc - cache: ${{ !env.ACT || '' }} # Disable cache for nektos/act - name: Install dependencies run: yarn --immutable From d034141ee3e359c07ab937efe7c19bfdcfb36c70 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 15:58:19 +0200 Subject: [PATCH 04/14] fix: bump checkout version --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 143dbcf..af125b2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 From fcf843c0caf33e5e2beaa6b5d1e7c24f4b6408a4 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 15:59:48 +0200 Subject: [PATCH 05/14] fix: add ref branch --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af125b2..50445f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + ref: "chore/npm-publish-auto" # Replace with your branch name - name: Use Node.js uses: actions/setup-node@v3 From 5109ff0cfceff2fcca4b24bbc62cfc53e3006a5e Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:02:16 +0200 Subject: [PATCH 06/14] chore: add from-package flag --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 50445f2..f009556 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,6 @@ jobs: # - name: Bootstrap Lerna # run: npx lerna bootstrap - name: Publish to npm - run: npx lerna publish --no-private --yes + run: npx lerna publish --from-package --no-private --yes env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} From 8efdd950e3672ce1ba58a0d30aef64b04f944106 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:02:48 +0200 Subject: [PATCH 07/14] Publish - @bam.tech/eslint-plugin@0.4.1 - @bam.tech/typescript-config@0.3.1 --- packages/eslint-plugin/package.json | 2 +- packages/typescript-config/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c90dfd0..823a80d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@bam.tech/eslint-plugin", - "version": "0.4.0", + "version": "0.4.1", "description": "eslint plugin for bam projects", "keywords": [ "eslint", diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json index f00d7e2..00e6232 100644 --- a/packages/typescript-config/package.json +++ b/packages/typescript-config/package.json @@ -1,6 +1,6 @@ { "name": "@bam.tech/typescript-config", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "peerDependencies": { "expo": ">=47" From f8cdb9be8f2427b8165e977ac75b61639aed1e6f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:04:18 +0200 Subject: [PATCH 08/14] fix: from-package not a flag --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f009556..bdc77a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,6 @@ jobs: # - name: Bootstrap Lerna # run: npx lerna bootstrap - name: Publish to npm - run: npx lerna publish --from-package --no-private --yes + run: npx lerna publish from-package --no-private --yes env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} From cf2d229f7bbfad102539b1f2728bac9905321d47 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:09:06 +0200 Subject: [PATCH 09/14] fix: replace NODE_AUTH_TOKEN with NPM_TOKEN --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bdc77a7..00a4e9d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,4 +26,4 @@ jobs: - name: Publish to npm run: npx lerna publish from-package --no-private --yes env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_TOKEN: ${{secrets.NPM_TOKEN}} From 359e0349c58dc522e9e280a5e9fdaa899b22e467 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:22:29 +0200 Subject: [PATCH 10/14] chore: bump eslint-plugin version --- packages/eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 823a80d..c9151cf 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@bam.tech/eslint-plugin", - "version": "0.4.1", + "version": "0.4.2", "description": "eslint plugin for bam projects", "keywords": [ "eslint", From 64170a718bfa82247868bb072f9ed5fd4fb4df8f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:42:18 +0200 Subject: [PATCH 11/14] chore: up lerna log level --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 00a4e9d..c95bd11 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,6 +24,6 @@ jobs: # - name: Bootstrap Lerna # run: npx lerna bootstrap - name: Publish to npm - run: npx lerna publish from-package --no-private --yes + run: npx lerna publish from-package --no-private --yes --loglevel "verbose" env: NPM_TOKEN: ${{secrets.NPM_TOKEN}} From ae3b21c10c46bc311a5dd0031fd3548bfead971b Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 16:52:22 +0200 Subject: [PATCH 12/14] chore: add bootstrap lerna job --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c95bd11..40d620d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,8 +21,9 @@ jobs: run: yarn --immutable # run: npm ci - # - name: Bootstrap Lerna - # run: npx lerna bootstrap + - name: Bootstrap Lerna + run: npx lerna bootstrap + - name: Publish to npm run: npx lerna publish from-package --no-private --yes --loglevel "verbose" env: From 37003c58de9f63a1d7b3ba3746da70f7b791b720 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 17:01:31 +0200 Subject: [PATCH 13/14] fix: add npmrc file writing job --- .github/workflows/publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 40d620d..7401241 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,8 +21,11 @@ jobs: run: yarn --immutable # run: npm ci - - name: Bootstrap Lerna - run: npx lerna bootstrap + # - name: Bootstrap Lerna + # run: npx lerna bootstrap + + - name: Set up .npmrc file + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - name: Publish to npm run: npx lerna publish from-package --no-private --yes --loglevel "verbose" From 46ebef2d4da373a28c6968d1986d52fa61da4156 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Aug 2023 17:06:38 +0200 Subject: [PATCH 14/14] chore: changed event to push tags and branch to main --- .github/workflows/publish.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7401241..d4f27a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,9 @@ name: Publish to npm -on: pull_request +on: + push: + tags: + - "*" jobs: publish: @@ -10,7 +13,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 with: - ref: "chore/npm-publish-auto" # Replace with your branch name + ref: "main" # Replace with your branch name - name: Use Node.js uses: actions/setup-node@v3 @@ -19,15 +22,11 @@ jobs: - name: Install dependencies run: yarn --immutable - # run: npm ci - - # - name: Bootstrap Lerna - # run: npx lerna bootstrap - name: Set up .npmrc file run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - name: Publish to npm - run: npx lerna publish from-package --no-private --yes --loglevel "verbose" + run: npx lerna publish from-package --no-private --yes env: NPM_TOKEN: ${{secrets.NPM_TOKEN}}