-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add semantic release GH action (#68)
- Loading branch information
1 parent
3242315
commit f419274
Showing
9 changed files
with
201 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,37 @@ This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By p | |
you are expected to uphold this code. Please report unacceptable behavior to | ||
[[email protected]](mailto:[email protected]). | ||
|
||
## Release | ||
- based on Angular Commit Message Conventions in commits - | ||
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-header | ||
- Commit message format is used to build: | ||
* Release notes | ||
* Changelog updates | ||
* NPM package semver | ||
|
||
## Commit message Convention | ||
|
||
``` | ||
<type>(<scope>): <short summary> | ||
│ │ │ | ||
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end. | ||
│ │ | ||
│ └─⫸ Commit Scope (optional): project|based|list | ||
│ | ||
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test | ||
``` | ||
|
||
|
||
### Major Version Release: | ||
|
||
In order to trigger Major Version upgrade, `BREAKING CHANGE:` needs to be in the footer of a commit message: | ||
|
||
``` | ||
<type>(<scope>): <short summary> | ||
<BLANK LINE> | ||
BREAKING CHANGE: <breaking change summary> | ||
``` | ||
|
||
## Have A Question? | ||
|
||
Start by filing an issue. The existing committers on this project work to reach | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [20.x] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Manual Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version' | ||
type: choice | ||
required: true | ||
default: fix | ||
options: | ||
- fix | ||
- feat | ||
- BREAKING CHANGE | ||
dryRun: | ||
description: 'DryRun' | ||
type: boolean | ||
default: true | ||
# ENV and Config | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.ADOBE_BOT_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: '["20.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@v4 | ||
- name: Setup Node.js ${{ matrix.NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.NODE_VERSION }} | ||
- name: Commit trigger | ||
run: | | ||
git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release | ||
${{ github.event.inputs.version }}:Forced Manual Release without code changes" | ||
- 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@v4 | ||
with: | ||
dry_run: ${{ github.event.inputs.dryRun == 'true' }} | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/git |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ 20.x ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
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@v4 | ||
with: | ||
dry_run: true | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/git | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }} | ||
GIT_AUTHOR_NAME: github-actions | ||
GIT_AUTHOR_EMAIL: [email protected] | ||
GIT_COMMITTER_NAME: github-actions | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
CI: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} | ||
] | ||
] | ||
} |
Empty file.