Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed May 11, 2021
0 parents commit 20c464c
Show file tree
Hide file tree
Showing 29 changed files with 14,775 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
coverage/
dist/
node_modules/
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts/"
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jef
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: jef
custom: ["https://www.paypal.me/jxf"]
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "\U0001F41B Bug report"
about: Report a bug for this project
title: ''
labels: ''
assignees: ''

---

## Expected Behavior

<!-- Tell us what should happen -->

## Current Behavior

<!-- Tell us what happens instead of the expected behavior -->

## Steps to Reproduce

<!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. -->
<!-- Include code to reproduce, if relevant -->

## Logs

<!-- Provide a brief log -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💡 Have an idea for a new feature?
url: https://github.com/jef/conventional-commits-release-action/discussions
about: Create a new idea discussion!
- name: 🙇 Need help?
url: https://github.com/jef/conventional-commits-release-action/discussions
about: Create a new help discussion if it hasn't been asked before!
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Please use Conventional Commits to label your title -->
<!-- https://www.conventionalcommits.org/en/v1.0.0/ -->
<!-- Example: feat: allow provided config object to extend other configs -->

### Description

<!-- Fixes #(issue) -->
<!-- Please also include relevant motivation and context. -->

### Testing

<!-- Please describe the tests that you ran to verify your changes. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->

### New dependencies

<!-- List any dependencies that are required for this change. -->
<!-- Otherwise, delete section. -->
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Continuous Integration
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build-lint:
name: Build and lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 12.20.1
- name: Setup build cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Compile TypeScript
run: npm run compile
- name: Run linter
run: npm run lint
18 changes: 18 additions & 0 deletions .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pull Request Linter
on:
pull_request:
types:
- opened
- edited
- reopened
jobs:
lint-pr:
name: Lint pull request title
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Lint pull request title
uses: jef/conventional-commits-pr-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main
jobs:
build-tag-release:
name: Build, tag, and release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup release please
uses: google-github-actions/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
changelog-path: CHANGELOG.md
package-name: conventional-commits-release-action
- name: Tag major version
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git push origin v${{ steps.release.outputs.major }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
.vscode/

build/
coverage/
node_modules/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.20.1
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('gts/.prettierrc.json')
}
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Jef LeCompte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# conventional-commits-release-action

Creates releases based on [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/).

## Usage

```yaml
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Release
uses: jef/conventional-commits-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```

## Inputs

- `create-major`: Creates a major tag as well as Semantic Version. Default is `false`.
- `token` [**Required**]: Access token to the repository. Usually `${{ secrets.GITHUB_TOKEN }}`.

## Outputs

- `tag`: The tag that was created.

## Contributing

There are few npm tasks that will help you in building and packaging. All commands are prefaced by `npm run`.

- `build`: builds the action.
- `compile`: transpiles TypeScript.
- `clean`: removes `build` directory.
- `fix`: fixes lint and format issues.
- `lint`: runs linter and checks format issues.
- `start`: runs the action.
- `test`: tests the action.
16 changes: 16 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Conventional Commits Release
description: Creates releases based on Conventional Commits
branding:
icon: align-left
color: blue
inputs:
create-major:
required: false
description: Creates a major tag as well as Semantic Version.
default: 'false'
token:
required: true
description: Access token to the repository.
runs:
using: node12
main: dist/index.js
Loading

0 comments on commit 20c464c

Please sign in to comment.