Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Publish js pkgs on gh pkg registry (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriziovitale committed Mar 6, 2023
1 parent 2414d22 commit 3dea8b1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/js-api-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
needs: test
name: release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.event.schedule == '0 3 * * *'
steps:
- name: Checkout
Expand All @@ -98,12 +101,33 @@ jobs:
cache: 'npm'
- run: npm ci

- name: Release
- name: Release Build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
shell: bash
run: |
./scripts/build.sh || exit 1
./scripts/publish.sh
- uses: actions/setup-node@v3
name: Release library GH registry
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
with:
node-version: 16
registry-url: 'https://npm.pkg.github.com'
scope: '@alfresco'
- run: ./scripts/publish.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
name: Release library Npm registry
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
with:
node-version: 16
registry-url: $NPM_REGISTRY_ADDRESS
scope: '@alfresco'
- run: ./scripts/publish.sh nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
env:
NODE_AUTH_TOKEN: $NPM_REGISTRY_TOKEN

- name: Release Tag
if: github.ref == 'refs/heads/master'
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ echo '//${NPM_REGISTRY_ADDRESS}/:_authToken="${NPM_REGISTRY_TOKEN}"' >>.npmrc

cat package.json | grep version

npm publish --tag ${TAG_NPM} --access public || exit 1
npm publish --tag ${TAG_NPM} || exit 1
rm -rf .npmrc

0 comments on commit 3dea8b1

Please sign in to comment.