Skip to content
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

GitHub workflow #6

Merged
merged 19 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@ on:
- main

jobs:
build-library:
build_library:
name: build library
runs-on: ubuntu-latest
strategy:
matrix:
version: [16.x, 18.x]
outputs:
version: ${{ steps.package-version.outputs.version}}

steps:
- name: checkout code
uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
node-version: 16

- name: change directory
run: |
pwd
cd ./projects/we-select

- name: package version
id: package-version
run: echo "version=$(npm pkg get version | tr -d \")" >> $GITHUB_OUTPUT


- name: install angular CLI
run: npm install -g @angular/cli
Expand All @@ -33,3 +43,30 @@ jobs:
- name: run tests
run: ng test we-select --watch=false --browsers=ChromeHeadless



push_tags:
name: publish tags to github
needs: build_library
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3

- name: git configuration
run: |
git config --global user.name "navenkumar"
git config --global user.email "naven.duraisamy5859@gmail.com"

- name: print version output
run: echo "${{ needs.build_library.outputs.version }}"

- name: create tags
run: git tag v${{ needs.build_library.outputs.version }}


- name: Push tags to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin --tags

27 changes: 3 additions & 24 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
name: Publish Package to npmjs
on:
workflow_dispatch:
inputs:
version_bump:
type: choice
required: true
description: version to bump
options:
- major
- minor
- patch
release:
types:
- published

jobs:
build:
Expand All @@ -22,20 +15,6 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci

- name: git configuration
run: |
git config --global user.name "navenkumar"
git config --global user.email "naven.duraisamy5859@gmail.com"

- name: update version
run: npm version ${{ github.event.inputs.version_bump }}

- name: Push changes to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin && git push --tags

- name: publish to npm registry
run: npm publish
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "we-select",
"version": "2.0.0",
"version": "2.1.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
2 changes: 1 addition & 1 deletion projects/we-select/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "we-select",
"version": "0.0.1",
"version": "2.1.0",
"peerDependencies": {
"@angular/common": "^14.2.0",
"@angular/core": "^14.2.0"
Expand Down