-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up [semantic-release](https://semantic-release.gitbook.io/semantic-release/) version and release management tool. This will be used for automating releases and publishing new versions.
- Loading branch information
1 parent
f2d51bf
commit 504e493
Showing
5 changed files
with
6,930 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: CD | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
release: | ||
# Only run on the 'main' and 'develop' branches. | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | ||
needs: [ build ] | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.FYJ_GH_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
|
||
- name: Install requirements | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
- name: Set up GPG | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
git_commit_gpgsign: true | ||
git_committer_email: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }} | ||
git_committer_name: ${{ secrets.FYJ_GIT_COMMITTER_NAME }} | ||
# Currently, signing commits leads to the CI hanging indefinitely. | ||
# See https://github.com/semantic-release/semantic-release/issues/3065 | ||
git_tag_gpgsign: false | ||
git_user_signingkey: true | ||
gpg_private_key: ${{ secrets.FYJ_GPG_KEY }} | ||
passphrase: ${{ secrets.FYJ_GPG_KEY_PASSPHRASE }} | ||
trust_level: 5 | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
node-version-file: .nvmrc | ||
|
||
- name: Install semantic-release | ||
run: npm ci | ||
|
||
- name: Create a release | ||
env: | ||
DEBUG: semantic-release:* | ||
GIT_AUTHOR_EMAIL: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }} | ||
GIT_AUTHOR_NAME: ${{ secrets.FYJ_GIT_COMMITTER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.FYJ_GIT_COMMITTER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.FYJ_GIT_COMMITTER_NAME }} | ||
GITHUB_TOKEN: ${{ secrets.FYJ_GH_TOKEN }} | ||
run: npx semantic-release |
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 @@ | ||
lts/* |
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,90 @@ | ||
branches: | ||
- main | ||
- name: develop | ||
channel: dev | ||
prerelease: dev | ||
plugins: | ||
- '@semantic-release/commit-analyzer' | ||
- - '@semantic-release/release-notes-generator' | ||
- linkCompare: true | ||
linkReferences: true | ||
writerOpts: | ||
commitGroupsSort: | ||
- type | ||
- title | ||
commitSort: | ||
- scope | ||
- subject | ||
- - semantic-release-replace-plugin | ||
- replacements: | ||
- countMatches: true | ||
files: | ||
- package.json | ||
from: '"version": ".*",' | ||
to: '"version": "${nextRelease.version}",' | ||
results: | ||
- file: package.json | ||
hasChanged: true | ||
numMatches: 1 | ||
numReplacements: 1 | ||
- - '@semantic-release/changelog' | ||
- changelogFile: docs/CHANGELOG.md | ||
- - '@semantic-release/git' | ||
- assets: | ||
- docs/CHANGELOG.md | ||
- package.json | ||
message: "release: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
- - '@semantic-release/exec' | ||
- publishCmd: "export GITHUB_TOKEN='${process.env.GITHUB_TOKEN}'; tox -e package" | ||
- - '@semantic-release/github' | ||
- assets: | ||
- path: dist/* | ||
tagFormat: v${version} | ||
# ------------------------------------------------------------------------------ | ||
# GLOBAL PLUGIN OPTIONS | ||
# See: https://github.com/semantic-release/semantic-release/blob/master/docs/usage/plugins | ||
# .md#plugin-options-configuration | ||
# ------------------------------------------------------------------------------ | ||
parserOptions: | ||
noteKeywords: | ||
- BREAKING CHANGES | ||
- BREAKING CHANGE | ||
- BREAKING | ||
preset: conventionalcommits | ||
presetConfig: | ||
types: | ||
- type: build | ||
hidden: true | ||
- type: ci | ||
hidden: true | ||
- type: chore | ||
scope: deps | ||
section: Dependency Updates | ||
- type: chore | ||
section: Refactors | ||
- type: docs | ||
scope: api | ||
section: Documentation Updates | ||
- type: docs | ||
hidden: true | ||
- type: feat | ||
section: Features | ||
- type: fix | ||
section: Bug Fixes | ||
- type: release | ||
hidden: true | ||
- type: test | ||
section: hidden | ||
releaseRules: | ||
- type: chore | ||
scope: deps | ||
release: patch | ||
- type: docs | ||
scope: api | ||
release: patch | ||
- type: feat | ||
release: minor | ||
- type: fix | ||
release: patch | ||
- scope: no-release | ||
release: false |
Oops, something went wrong.