Skip to content

Commit

Permalink
succesful publish
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasengels committed Nov 14, 2024
1 parent 4e05e0a commit 697d963
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 1,816 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-release-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: npm run build --prod

- name: Create .npmrc
run: echo "@govflanders:registry=https://registry.npmjs.org//registry.npmjs.org/:_authToke=${{ secrets.NPMJS_TOKEN }}" > ~/.npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to npm
run: npm publish
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
71 changes: 46 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
name: Release
on:
workflow_dispatch
name: Build and Publish Angular Library with Semantic Versioning

permissions:
contents: write
pull-requests: write
on:
push:
branches:
- main
paths:
- 'projects/ng-inbo/**' # Trigger on changes in the library folder

jobs:
release:
name: Release
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x, 22.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [ 20.x ]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci
- name: release-please-action
uses: googleapis/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple




node-version: 20

- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci # Use npm ci for faster, deterministic installs

- name: Install Angular CLI
run: npm install -g @angular/[email protected]

- name: Build Angular library
run: ng build ng-inbo --configuration production

- name: Set up semantic-release
run: npm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/npm

- name: Set up .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for releasing
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM token for publishing
run: npx semantic-release
- name: Publish to npm
run: npm publish --verbose
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 697d963

Please sign in to comment.