Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: setup cliff-jumper v4 and publishing workflow #762

Merged
merged 1 commit into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cliff-jumperrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ org: sapphire
monoRepo: false
commitMessageTemplate: 'chore(release): release {{new-version}}'
tagTemplate: v{{new-version}}
identifierBase: false
pushTag: true
githubRelease: true
githubReleaseLatest: true
githubRepo: sapphiredev/framework
2 changes: 1 addition & 1 deletion .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"

yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)"
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)" --skip-changelog

yarn npm publish --tag ${TAG}
env:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
workflow_dispatch:

jobs:
PublishPackage:
name: Publish @sapphire/framework
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ secrets.SKYRA_TOKEN }}
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
- name: Configure Git
run: |
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git"
git config --local user.email "${GITHUB_EMAIL}"
git config --local user.name "${GITHUB_USER}"
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump Versions and make release
run: yarn bump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NPM
run: |
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
5 changes: 0 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"eslint.validate": ["typescript"],
"editor.tabSize": 4,
"editor.useTabStops": true,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"files.eol": "\n",
"sonarlint.connectedMode.project": {
"connectionId": "https-sonarqube-sapphirejs-dev",
Expand Down
74 changes: 44 additions & 30 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,38 @@ header = """
All notable changes to this project will be documented in this file.\n
"""
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% if version %}\
# [{{ version | trim_start_matches(pat="v") }}]\
{% if previous %}\
{% if previous.version %}\
(https://github.com/sapphiredev/framework/compare/{{ previous.version }}...{{ version }})\
{% else %}\
(https://github.com/sapphiredev/framework/tree/{{ version }})\
{% endif %}\
{% endif %} \
- ({{ timestamp | date(format="%Y-%m-%d") }})
# [{{ version | trim_start_matches(pat="v") }}]\
{% if previous %}\
{% if previous.version %}\
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }})\
{% else %}\
({{ self::remote_url() }}/tree/{{ version }})\
{% endif %}\
{% endif %} \
- ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
# [unreleased]
# [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
## {{ group | upper_first }}
{% for commit in commits %}
## {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/sapphiredev/framework/commit/{{ commit.id }}))\
{% endif %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% if commit.github.pr_number %} (\
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) by @{{ commit.github.username }}) \
{%- endif %}\
{% if commit.breaking %}\
{% for breakingChange in commit.footers %}\
\n{% raw %} {% endraw %}- 💥 **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\
{% endfor %}\
{% endif %}\
{% endfor %}
{% endfor %}
{% endfor %}\n
"""
trim = true
Expand All @@ -40,24 +46,32 @@ footer = ""
conventional_commits = true
filter_unconventional = true
commit_parsers = [
{ message = "^feat", group = "🚀 Features"},
{ message = "^fix", group = "🐛 Bug Fixes"},
{ message = "^docs", group = "📝 Documentation"},
{ message = "^perf", group = "🏃 Performance"},
{ message = "^refactor", group = "🏠 Refactor"},
{ message = "^typings", group = "⌨️ Typings"},
{ message = "^types", group = "⌨️ Typings"},
{ message = ".*deprecated", body = ".*deprecated", group = "🚨 Deprecation"},
{ message = "^revert", skip = true},
{ message = "^style", group = "🪞 Styling"},
{ message = "^test", group = "🧪 Testing"},
{ message = "^chore", skip = true},
{ message = "^ci", skip = true},
{ message = "^build", skip = true},
{ body = ".*security", group = "🛡️ Security"},
{ message = "^feat", group = "🚀 Features" },
{ message = "^fix", group = "🐛 Bug Fixes" },
{ message = "^docs", group = "📝 Documentation" },
{ message = "^perf", group = "🏃 Performance" },
{ message = "^refactor", group = "🏠 Refactor" },
{ message = "^typings", group = "⌨️ Typings" },
{ message = "^types", group = "⌨️ Typings" },
{ message = ".*deprecated", body = ".*deprecated", group = "🚨 Deprecation" },
{ message = "^revert", skip = true },
{ message = "^style", group = "🪞 Styling" },
{ message = "^test", group = "🧪 Testing" },
{ message = "^chore", skip = true },
{ message = "^ci", skip = true },
{ message = "^build", skip = true },
{ body = ".*security", group = "🛡️ Security" },
]
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\s\((\w+\s)?#([0-9]+)\)', replace = "" },
]
filter_commits = true
tag_pattern = "v[0-9]*"
ignore_tags = ""
topo_order = false
sort_commits = "newest"

[remote.github]
owner = "sapphiredev"
repo = "framework"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@favware/cliff-jumper": "^3.0.3",
"@favware/cliff-jumper": "^4.0.2",
"@favware/npm-deprecate": "^1.0.7",
"@favware/rollup-type-bundler": "^3.3.0",
"@sapphire/eslint-config": "^5.0.5",
Expand All @@ -70,7 +70,7 @@
"gen-esm-wrapper": "^1.1.3",
"lint-staged": "^15.2.5",
"prettier": "^3.3.1",
"tsup": "^8.0.2",
"tsup": "^8.1.0",
"typedoc": "^0.25.13",
"typedoc-json-parser": "^10.0.0",
"typescript": "^5.4.5",
Expand Down
Loading