Skip to content

Commit

Permalink
feat: add npm publish job for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Dec 10, 2023
1 parent 544bf92 commit 2802c92
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ permissions:
contents: read # for checkout

jobs:
release:
name: Release
version:
name: Version Packages
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
Expand Down Expand Up @@ -39,3 +39,35 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

publish:
name: Publish Packages
runs-on: ubuntu-latest
needs:
- version
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .node-version
- run: corepack enable
- run: pnpm --version
- name: Install dependencies
uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: pnpm build --skip-nx-cache
- name: Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
TAG="$(${{ github.ref_name == 'main' }} && echo 'latest' || echo '${{ github.ref_name }}')"
./tools/publish.sh
18 changes: 9 additions & 9 deletions tools/publish.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

npm publish node_modules/@analogjs/astro-angular --access public
npm publish node_modules/@analogjs/content --access public
npm publish node_modules/@analogjs/platform --access public
npm publish node_modules/@analogjs/router --access public
npm publish node_modules/@analogjs/trpc --access public
npm publish node_modules/@analogjs/vite-plugin-angular --access public
npm publish node_modules/@analogjs/vite-plugin-nitro --access public
npm publish dist/packages/create-analog
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish node_modules/@analogjs/astro-angular --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/content --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/platform --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/router --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/trpc --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/vite-plugin-angular --access public --tag $TAG --dry-run
npm publish node_modules/@analogjs/vite-plugin-nitro --access public --tag $TAG --dry-run
npm publish dist/packages/create-analog --tag $TAG --dry-run

0 comments on commit 2802c92

Please sign in to comment.