From d329fa6a152b9008e3e4438ac1493ecad71f219c Mon Sep 17 00:00:00 2001 From: jrea Date: Wed, 22 May 2024 10:50:49 -0400 Subject: [PATCH] fix(repo): publish to git, fix build --- .github/workflows/package-github.yaml | 0 .github/workflows/package.yaml | 2 +- .github/workflows/prerelease.yaml | 17 +++++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/package-github.yaml diff --git a/.github/workflows/package-github.yaml b/.github/workflows/package-github.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index b4303ed9..3be649f8 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -5,7 +5,7 @@ on: branches: - stable jobs: - build: + package: runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/prerelease.yaml b/.github/workflows/prerelease.yaml index 57eeaf89..b0ef4c3d 100644 --- a/.github/workflows/prerelease.yaml +++ b/.github/workflows/prerelease.yaml @@ -16,7 +16,7 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 ref: main @@ -27,9 +27,9 @@ jobs: # Setup .npmrc file to publish to GitHub Packages - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: "lts/*" + node-version: "20.x" # registry-url: 'https://npm.pkg.github.com' # Defaults to the user or organization that owns the workflow file # scope: '@niledatabase' @@ -63,8 +63,17 @@ jobs: git config user.email "${{ github.actor }}@users.noreply.github.com" npx lerna version --force-publish --conventional-prerelease --conventional-commits --yes - - name: Publish + - name: Publish to npm env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | npx lerna publish from-git --yes + + - name: Update npm for git + run: | + rm -rf .npmrc + echo "@niledatabase:registry=https://npm.pkg.github.com/" >> .npmrc + echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc + + - name: Publish to git + run: npx lerna publish from-git --yes