From 5ffe13b72387ff83e656bbd308b43974fc24154d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 Oct 2022 15:12:24 -0400 Subject: [PATCH] Npm gitea publish (#200) * update gitignore for goland and first attempt at git.vdb.to npm publish * whitespace yaml nonsense * missing run entry * lerna is not cicd friendly, yet * try from-git arg in lerna.json * attempt default lerna publish with full checkout * explicit cli args... lerna.json ??? * explicit cli args... from-package is not --arg * make publish yaml match manual workflow --- .github/workflows/manual_npm_publishl.yml | 9 ++++--- .github/workflows/publish.yaml | 33 +++++++++++++++++++++++ .gitignore | 1 + lerna.json | 4 ++- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual_npm_publishl.yml b/.github/workflows/manual_npm_publishl.yml index 69e7e753..ebb9eedb 100644 --- a/.github/workflows/manual_npm_publishl.yml +++ b/.github/workflows/manual_npm_publishl.yml @@ -15,7 +15,10 @@ jobs: matrix: node-version: [ 16.x ] steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -35,7 +38,7 @@ jobs: - name: Authenticate to git.vdb.to registry run: | npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" - - name: yarn publish + - name: lerna publish run: | - yarn publish:workspace + lerna publish from-package --no-git-tag-version --yes diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2df96eb4..698d2c1c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -20,3 +20,36 @@ jobs: run: docker tag ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.sha}} ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.tag}} - name: Docker Push to Github Hub run: docker push ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.tag}} + + npm_publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 16.x ] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://npm.pkg.github.com' + - run: yarn + env: + NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }} + - name: Run yarn build + env: + NODE_AUTH_TOKEN: ${{ secrets.PAT_PACKAGES }} + run: | + yarn build + - name: Configure git.vdb.to npm registry + run: | + npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/ + - name: Authenticate to git.vdb.to registry + run: | + npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" + - name: lerna publish + run: | + lerna publish from-package --no-git-tag-version --yes \ No newline at end of file diff --git a/.gitignore b/.gitignore index 82792c64..df4207ce 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist/ out/ .vscode +.idea \ No newline at end of file diff --git a/lerna.json b/lerna.json index ab78f2ac..30b469ac 100644 --- a/lerna.json +++ b/lerna.json @@ -7,7 +7,9 @@ "useWorkspaces": true, "command": { "publish": { - "registry": "https://git.vdb.to/api/packages/cerc-io/npm/" + "registry": "https://git.vdb.to/api/packages/cerc-io/npm/", + "yes": true, + "from-git": true } } }