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

breaking: Update package version #350

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .github/pr-branch-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Apply label "master" if base matches "master"
master:
base: "master"

# Apply label "qa" if base matches "qa"
dev:
base: "dev"
50 changes: 50 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# .github/pr-labeler.yml
# The bot always updates the labels, add/remove as necessary [default: false]
alwaysReplace: false
# Treats the text and labels as case-sensitive [default: true]
caseSensitive: true
# Array of labels to be applied to the PR [default: []]
customLabels:
# Finds the `text` within the PR title and body and applies the `label`
- text: 'hotfix:'
label: 'hotfix'
- text: 'test:'
label: 'test'
- text: 'feature'
label: 'feature'
- text: 'feat:'
label: 'feature'
- text: 'enhancement'
label: 'enhancement'
- text: 'fix:'
label: 'bug'
- text: 'bugfix'
label: 'fix'
- text: 'docs:'
label: 'documentation'
- text: 'build:'
label: 'build'
- text: 'ci:'
label: 'ci'
- text: 'style:'
label: 'style'
- text: 'refactor:'
label: 'refactor'
- text: 'perf:'
label: 'performance'
- text: 'chore:'
label: 'chore'
- text: 'revert:'
label: 'revert'
- text: 'release'
label: 'release'
- text: 'i18n'
label: 'i18n'
- text: 'breaking'
label: 'breaking'
# Search the body of the PR for the `text` [default: true]
searchBody: false
# Search the title of the PR for the `text` [default: true]
searchTitle: true
# Search for whole words only [default: false]
wholeWords: false
57 changes: 57 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name-template: '$RESOLVED_VERSION 🌈'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 New Changes'
labels:
- 'feature'
- 'breaking'
- title: '🎈Enhancements'
labels:
- 'enhancement'
- 'i18n'
- title: '🐛 Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'style'
- 'refactor'
- 'perf'
- 'build'
- 'ci'
- 'performance'
- title: '🧪 Test'
labels:
- 'test'
- title: '📄 Documentation'
labels:
- 'documentation'
- title: '⬆️ Dependencies'
collapse-after: 3
labels:
- 'dependencies'
- title: 'Others'
labels:
- 'revert'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'feature'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes

$CHANGES
79 changes: 79 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
release:
types: [ published ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.11
cache: npm

- name: Install Angular
run: |
echo "$(ls -la)"
npm install -g @angular/[email protected]
ng v

- name: Install npm dependencies
run: npm install --include=dev

- name: Build preview library
run: |
npm run build:lib

- name: Build application
run: |
npm run build:demo
echo "$(ls -la dist/)"

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: artifact
path: './dist/angular-ngx-treeview'
retention-days: 1

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
60 changes: 60 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.11
cache: npm

- name: Install Angular
run: |
echo "$(ls -la)"
npm install -g @angular/[email protected]
ng v

- name: Install npm dependencies
run: npm install --include=dev

- name: Build preview library
run: |
npm run build:lib

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: artifact
path: './dist/ngx-treeview2'
retention-days: 1

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: artifact

- name: Publish Package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
19 changes: 19 additions & 0 deletions .github/workflows/pr-branch-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Branch Labeler

on:
pull_request:
types:
- opened
pull_request_target:
types:
- opened

jobs:
label_prs:
runs-on: ubuntu-latest
steps:
- name: Label PRs
if: github.event.action == 'opened' # Only run the action when the PR was first opened
uses: ffittschen/pr-branch-labeler@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Label Pull Request"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- name: Checkout your code
uses: actions/checkout@v3

- uses: srvaroa/labeler@master
with:
config_path: .github/pr-labeler.yml
use_local_config: false
fail_on_error: false
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
40 changes: 40 additions & 0 deletions .github/workflows/pr-semantic-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ignoreLabels: |
hotfix
dependencies
release
types: |
feat
feature
enhancement
fix
bugfix
hotfix
docs
style
refactor
perf
test
build
ci
chore
revert
i18n
breaking
Loading