Skip to content

Commit

Permalink
[init] merge npm template to pre-release code, to keep history
Browse files Browse the repository at this point in the history
  • Loading branch information
easingthemes committed Sep 23, 2023
1 parent 76cdffc commit 03239e8
Show file tree
Hide file tree
Showing 29 changed files with 698 additions and 37 deletions.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--- STOP! Before you open an issue please search this repository's issues to see if it has already been reported. This helps reduce duplicate issues from being created. -->

### Expected Behaviour

### Actual Behaviour

### Reproduce Scenario (including but not limited to)

#### Steps to Reproduce

#### Platform and Version

#### Sample Code that illustrates the problem

#### Logs taken while reproducing problem
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--- Provide a general summary of your changes in the Title above
Use Angular Commit Message Conventions in commits -
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-header
-->

## Description

<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues
If suggesting a new feature or change, please discuss it in an issue first
If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--
To automatically close linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes #

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] My code follows the code style of this project.
- [ ] I have read the **[CONTRIBUTING](docs/CONTRIBUTING.mnd)** document.
- [ ] All new and existing tests passed.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [ '**' ]
pull_request:
branches: [ $default-branch ]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Build Library
run: npm run build --if-present
- name: Run Tests
run: npm test --if-present
45 changes: 45 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '20 12 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
steps:
- name: Checkout
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- run: npm run build --if-present

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
73 changes: 73 additions & 0 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Manual Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
type: choice
required: true
default: patch
options:
- patch
- minor
- major
dryRun:
description: 'DryRun'
type: boolean
default: true
# ENV and Config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: [email protected]
CI: true
CONFIG_NODE_VERSION: '["16.x"]'
CONFIG_OS: '["ubuntu-latest"]'
# Main Job
jobs:
config:
runs-on: ubuntu-latest
outputs:
NODE_VERSION: ${{ steps.set-config.outputs.CONFIG_NODE_VERSION }}
OS: ${{ steps.set-config.outputs.CONFIG_OS }}
steps:
- id: set-config
run: |
echo "CONFIG_NODE_VERSION=${{ toJSON(env.CONFIG_NODE_VERSION) }}" >> $GITHUB_OUTPUT
echo "CONFIG_OS=${{ toJSON(env.CONFIG_OS) }}" >> $GITHUB_OUTPUT
release:
name: Test, Build and force Release
needs: config

runs-on: ${{ matrix.OS }}
strategy:
matrix:
OS: ${{ fromJSON(needs.config.outputs.OS) }}
NODE_VERSION: ${{ fromJSON(needs.config.outputs.NODE_VERSION) }}

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Commit trigger
run: |
git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release"
- name: Install dependencies
run: npm ci
- name: Build Library
run: npm run build --if-present
- name: Run Tests
run: npm test --if-present
- name: Publish npm package
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: ${{ github.event.inputs.dryRun == 'true' }}
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Test, Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [ 16.x ]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix['node-version'] }}
- name: Install dependencies
run: npm ci
- name: Build Library
run: npm run build --if-present
- name: Run Tests
run: npm test --if-present
- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: true
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: [email protected]
CI: true
36 changes: 32 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
npm-debug.log
node_modules
package-lock.json
.npmrc
# Logs
logs
*.log

# IDE
.project
.classpath
.settings
.idea/
*.iml*
*.ipr
.brackets.json
.vscode/
.history

# OS
.DS_Store
*.swp

# Node related files
node_modules/
node/
bin/
typings
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.stylelintcache
.eslintcache

# env
\.env
20 changes: 20 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.eslintrc
.nyc_output
rollup.config.js
.prettierrc
.git
.prettierignore
**/.git/
**/node_modules/
yarn.lock
/dev
/docs
/public
/coverage
/.vscode
/tests
/temp
/templates
/demos
/src
.github
20 changes: 20 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "docs/CHANGELOG.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": ["docs/CHANGELOG.md", "package.json"]
}
]
]
}
Loading

0 comments on commit 03239e8

Please sign in to comment.