Skip to content

Commit bd193ad

Browse files
authored
feat(ci): add release automation (#45)
feat(ci): add release automation (#45)
1 parent ec7845f commit bd193ad

File tree

9 files changed

+4260
-16450
lines changed

9 files changed

+4260
-16450
lines changed

.github/workflows/main.yml renamed to .github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
# This is a basic workflow to help you get started with Actions
2-
1+
# Main CI workflow for new PRs
32
name: CI
43

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
74
on:
85
pull_request:
96
branches: [master]
107

118
jobs:
12-
formatting-and-linting:
9+
code-formatting-and-linting:
1310
runs-on: ubuntu-latest
1411
steps:
1512
# Checkout the code in the pull request
@@ -49,6 +46,7 @@ jobs:
4946

5047
scratch-org-test:
5148
runs-on: ubuntu-latest
49+
needs: code-formatting-and-linting
5250
steps:
5351
# Install Salesforce CLI
5452
- name: Install Salesforce CLI

.github/workflows/pr-lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR Linting workflow
2+
name: PR-lint
3+
4+
on:
5+
pull_request:
6+
types: [edited, opened, reopened, synchronize]
7+
8+
jobs:
9+
commit-lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- uses: wagoid/commitlint-github-action@v2
16+
17+
pr-lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: amannn/[email protected]
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,7 @@ TestCache.xml
9090
TestsResultsCache.xml
9191

9292
tests/
93-
_site/
93+
_site/
94+
95+
# direnv
96+
.envrc

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx commitlint --edit

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

MAINTAINING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Maintaining
2+
3+
## Release Process
4+
5+
The release process is composed by multiple standards and utilities combined together:
6+
7+
- [Conventional Commits](https://conventionalcommits.org/) based on the [Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines) are used to keep standard commit messages all around the project
8+
- [Semantic Versioning (SemVer) Specification](https://semver.org/) is used to determine the version format of each new release
9+
- [conventional-changelog/standard-version](https://github.com/conventional-changelog/standard-version) automatizes the process of creating a new release based on the commit history
10+
- [conventional-github-releaser/conventional-github-releaser](https://github.com/conventional-changelog/releaser-tools/tree/master/packages/conventional-github-releaser) takes care of publishing the new release on GitHub
11+
12+
### Pre-requisites
13+
14+
1. Create a new [GitHub Personal Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
15+
2. Set the `CONVENTIONAL_GITHUB_RELEASER_TOKEN` environment variable with the github personal token value (you can use [direnv](https://direnv.net/))
16+
17+
### Releasing a new version
18+
19+
```sh
20+
$ npm run release
21+
```
22+
23+
This command will:
24+
25+
- Create a new version based on the commit types from `HEAD` and `package.json` version
26+
- Create the changelog with all the commits from `HEAD` and the last tag version following [keepachangelog](https://keepachangelog.com/en/1.0.0/)
27+
- Create a new commit to update the following files: `CHANGELOG.md`, `package.json` and `package-lock.json`
28+
- Create a new tag following the SemVer Standard
29+
- Push this tag to the remote
30+
- Trigger the new version publication

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-angular'] };

0 commit comments

Comments
 (0)