-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e05e0a
commit 697d963
Showing
5 changed files
with
292 additions
and
1,816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.