-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish to Github packages #1724
Comments
I don't think it makes sense to publish a package to both, the npm registry and GitHub's packages' registry. The latter falls back to the former. If you want to publish just to GitHub packages, you can do so with https://github.com/semantic-release/npm/ by configuring the registry (https://docs.npmjs.com/cli/v6/using-npm/registry#i-dont-want-my-package-published-in-the-official-registry-its-private) |
When I attempt to publish to GitHub packages, I get ...
- name: Build, Test and Publish REST Client
working-directory: ./src/RestApi.Client
run: |
npm ci
npm run generate /variables:Configuration=Release
npm run build --if-present
npm run test
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
... |
This needs to be a different token one you generate that has access to write packages... I do not believe the generic According to the docs you might be able to adjust the token to have permissions. |
Sorry, I forgot about this and didn't follow up after I "solved" it. The github token did work for me but I had to supply |
I feel like setting only |
For completeness, what seems to be working for me is something like this: .github/semantic.yml titleOnly: true .github/workflows/develop-branch.yml (also in our master-branch.yml) name: Build, Test and Package For Develop Branch
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v1
with:
node-version: 15
registry-url: https://npm.pkg.github.com/
scope: "@..."
- name: Build, Test and Publish REST Client
working-directory: ./src/RestApi.Client
run: |
npm ci
npm run generate /variables:Configuration=Release
npm run build --if-present
npm run test
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} package.json {
"name": "@.../...",
"version": "0.0.0-development",
"description": "...",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"scripts": {
...
},
"repository": {
"url": "github:.../..."
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"release": {
"branches": [
{ "name": "master" },
{ "name": "develop", "channel": "beta", "prerelease": "beta" }
]
}
} I think those were all the relevant bits to get it to work. |
The In order to fix the semantic-release publish we replaced the - name: Publish
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
same error here |
is there any solution to utilize this to automate publishing to Github packages.
we do many skips on version bumping. we want it to be harmonious with what we publish on npm.
The text was updated successfully, but these errors were encountered: