Skip to content

Commit

Permalink
fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Apr 10, 2024
1 parent b95edb1 commit 228aa14
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions .github/workflows/napi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,39 +90,49 @@ jobs:
name: bindings-${{ matrix.settings.target }}
path: libs/napi/${{ env.APP_NAME }}.*.node
if-no-files-found: error
publish-lib:
name: Publish Lib

publish:
name: publish to npm
runs-on: ubuntu-latest
defaults:
run:
working-directory: libs/napi
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Setup node
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies

- name: install dependencies (lib)
run: yarn install
working-directory: libs/napi

- name: install dependencies (bin)
run: yarn install
working-directory: bin/npm

- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: libs/napi/artifacts

- name: Move artifacts
run: yarn artifacts
working-directory: libs/napi

- name: List packages
run: ls -R ./npm
shell: bash
working-directory: libs/napi

- name: Update version to match release tag and commit
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
cd libs/napi
npm version $TAG_NAME --no-git-tag-version
cd ../../bin/npm
cd ../../
cd bin/npm
npm version $TAG_NAME --no-git-tag-version
cd ../..
git config user.name "github-actions"
git config user.email "[email protected]"
git add .
Expand All @@ -131,7 +141,8 @@ jobs:
GITHUB_REF: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
- name: publish lib
working-directory: libs/napi
run: |
npm config set provenance true
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand All @@ -140,23 +151,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-bin:
name: Publish Bin
runs-on: ubuntu-latest
defaults:
run:
- name: publish bin
working-directory: bin/npm
needs:
- publish-lib
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Publish
run: |
npm config set provenance true
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand Down

0 comments on commit 228aa14

Please sign in to comment.