Skip to content

Commit

Permalink
Merge pull request #3 from derekherman/develop
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
derekherman authored Feb 28, 2021
2 parents f8bd352 + ffc038f commit a429bd0
Show file tree
Hide file tree
Showing 15 changed files with 13,282 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
89 changes: 89 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI/CD Pipeline

on:
push:
branches:
- '**'
- '!main'
- '![0-9]+.[0-9]+'
pull_request:
types: [ closed ]
branches:
- 'main'
- '[0-9]+.[0-9]+'

jobs:
lint-js:
name: Lint JS
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci

- name: Detect coding standard violations
run: npm run lint

release:
needs: [ lint-js ]
if: ${{ github.event.pull_request.merged }}
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci

- name: Set the tag version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- name: Prepare Release
id: prepare-release
continue-on-error: true
uses: ./
with:
baseRef: ${{ github.base_ref }}
headRef: ${{ github.head_ref }}
tagRef: ${{ steps.package-version.outputs.current-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: actions/create-release@v1
if: steps.prepare-release.outcome == 'success' && steps.prepare-release.conclusion == 'success'
with:
tag_name: ${{ steps.package-version.outputs.current-version }}
release_name: ${{ steps.package-version.outputs.current-version }}
body: |
${{ steps.prepare-release.outputs.changelog }}
${{ steps.prepare-release.outputs.props }}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
node_modules/

# Editors
.vscode/
.idea/
*.iml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @actions/actions-runtime
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Prepare Release (GitHub Action)

[![CI/CD Pipeline](https://github.com/derekherman/prepare-release/workflows/CI/CD%20Pipeline/badge.svg?branch=develop)](https://github.com/derekherman/prepare-release/actions?query=workflow%3A%22CI%2FCD+Pipeline%22)

@todo

## Usage

```yaml
- name: Prepare Release
id: prepare-release
continue-on-error: true
uses: derekherman/prepare-release@main
with:
baseRef: ${{ github.base_ref }}
headRef: ${{ github.head_ref }}
tagRef: ${{ steps.package-version.outputs.current-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: actions/create-release@v1
if: steps.prepare-release.outcome == 'success' && steps.prepare-release.conclusion == 'success'
with:
tag_name: ${{ steps.package-version.outputs.current-version }}
release_name: ${{ steps.package-version.outputs.current-version }}
body: |
${{ steps.prepare-release.outputs.changelog }}
${{ steps.prepare-release.outputs.props }}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
See the [actions tab](https://github.com/derekherman/prepare-release/actions) for runs of this action! :rocket:
67 changes: 67 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Prepare Release'
description: 'Generates the changelog and contributors list since the last tag'
inputs:
baseRef:
description: 'The Base branch'
required: true
default: ''
headRef:
description: 'The HEAD branch'
required: true
default: ''
tagRef:
description: 'The new release tag'
required: true
default: ''
breakingChangeTitle:
description: 'The breaking change title'
required: false
default: '## :warning: Breaking Changes'
enhancementTitle:
description: 'The enhancement title'
required: false
default: '## :rocket: Features'
bugTitle:
description: 'The bug title'
required: false
default: '## :bug: Bugs'
regressionTitle:
description: 'The regression title'
required: false
default: '## :fire: Regressions'
testTitle:
description: 'The test title'
required: false
default: '## :white_check_mark: Tests'
dependencyTitle:
description: 'The dependency title'
required: false
default: '## :package: Dependencies'
documentationTitle:
description: 'The documentation title'
required: false
default: '## :page_facing_up: Documentation'
unlabeledTitle:
description: 'The unlabeled title'
required: false
default: '## :label: Unlabeled'
changelogMessage:
description: 'The changelog message'
required: false
default: 'If you are interested in contributing to the next version of this project, you can get started by reading the [documentation](/blob/main/README.md). :+1:'
propsMessage:
description: 'The props message'
required: false
default: 'Thanks to all the contributors who made this release possible through their work on development, design, testing, project management, and more:'
propsTitle:
description: 'The props message'
required: false
default: ':heart: Props'
outputs:
changelog:
description: 'The changelog markup'
props:
description: 'The props markup'
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit a429bd0

Please sign in to comment.