Skip to content

Commit

Permalink
Publish to GitHub packages in addition to npmjs
Browse files Browse the repository at this point in the history
  • Loading branch information
harmony7 committed Oct 24, 2024
1 parent d5e6d67 commit 9f3e9e5
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,39 @@ jobs:
uses: actions/checkout@v4
- name: "Fetch unshallow repo"
run: git fetch --prune --unshallow
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Set up auth for GitHub packages
run: |
npm config set "//npm.pkg.github.com/:_authToken" "\${NODE_AUTH_TOKEN}"
- name: Update npm packages to latest version
working-directory: ./npm/@fastly/cli
run: npm install && npm version "${{ github.ref_name }}" --allow-same-version
- name: Publish npm packages
- name: Publish packages to npmjs.org
working-directory: ./npm/@fastly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for dir in *; do
(
echo $dir
cd $dir
npm publish --access=public
)
done
- name: Publish packages to GitHub packages
working-directory: ./npm/@fastly
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm config set "@fastly:registry" "https://npm.pkg.github.com/"
for dir in *; do
(
echo $dir
cd $dir
npm config set "//registry.npmjs.org/:_authToken" "${{ secrets.NPM_TOKEN }}"
npm publish --access=public
)
done

0 comments on commit 9f3e9e5

Please sign in to comment.