Skip to content

Commit dd2e1a6

Browse files
authored
ci: setup cliff-jumper v4 and publishing workflow (#325)
* ci: setup cliff-jumper v4 and publishing workflow * chore: deps * Update continuous-delivery.yml * chore: pep8 - cause i fell like doing a barrel roll
1 parent cf44d7c commit dd2e1a6

File tree

7 files changed

+600
-441
lines changed

7 files changed

+600
-441
lines changed

.cliff-jumperrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ org: sapphire
44
monoRepo: false
55
commitMessageTemplate: 'chore(release): release {{new-version}}'
66
tagTemplate: v{{new-version}}
7+
identifierBase: false
8+
pushTag: true
9+
githubRelease: true
10+
githubReleaseLatest: true
11+
githubRepo: sapphiredev/cli

.github/workflows/continuous-delivery.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ jobs:
4747
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
4848
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
4949
50-
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)"
50+
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)" --skip-changelog
5151
5252
yarn npm publish --tag ${TAG}
5353
env:
5454
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
PublishPackage:
8+
name: Publish @sapphire/cli
9+
runs-on: ubuntu-latest
10+
if: github.repository_owner == 'sapphiredev'
11+
steps:
12+
- name: Checkout Project
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
ref: main
17+
token: ${{ secrets.SKYRA_TOKEN }}
18+
- name: Use Node.js v20
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: yarn
23+
registry-url: https://registry.yarnpkg.com/
24+
- name: Install Dependencies
25+
run: yarn --immutable
26+
- name: Configure Git
27+
run: |
28+
git remote set-url origin "https://${GITHUB_TOKEN}:[email protected]/${GITHUB_REPOSITORY}.git"
29+
git config --local user.email "${GITHUB_EMAIL}"
30+
git config --local user.name "${GITHUB_USER}"
31+
env:
32+
GITHUB_USER: github-actions[bot]
33+
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Bump Versions and make release
36+
run: yarn bump
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Publish to NPM
40+
run: |
41+
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
42+
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
43+
yarn npm publish
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.vscode/settings.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
2-
"eslint.validate": ["typescript"],
3-
"editor.tabSize": 4,
4-
"editor.useTabStops": true,
5-
"editor.insertSpaces": false,
6-
"editor.detectIndentation": false,
72
"files.eol": "\n",
83
"search.exclude": {
94
"**/node_modules": true,

cliff.toml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ header = """
55
All notable changes to this project will be documented in this file.\n
66
"""
77
body = """
8+
{%- macro remote_url() -%}
9+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
10+
{%- endmacro -%}
811
{% if version %}\
912
# [{{ version | trim_start_matches(pat="v") }}]\
1013
{% if previous %}\
1114
{% if previous.version %}\
12-
(https://github.com/sapphiredev/cli/compare/{{ previous.version }}...{{ version }})\
15+
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }})\
1316
{% else %}\
14-
(https://github.com/sapphiredev/cli/tree/{{ version }})\
17+
({{ self::remote_url() }}/tree/{{ version }})\
1518
{% endif %}\
1619
{% endif %} \
1720
- ({{ timestamp | date(format="%Y-%m-%d") }})
@@ -24,7 +27,10 @@ body = """
2427
- {% if commit.scope %}\
2528
**{{commit.scope}}:** \
2629
{% endif %}\
27-
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/sapphiredev/cli/commit/{{ commit.id }}))\
30+
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
31+
{% if commit.github.pr_number %} (\
32+
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) by @{{ commit.github.username }}) \
33+
{%- endif %}\
2834
{% if commit.breaking %}\
2935
{% for breakingChange in commit.footers %}\
3036
\n{% raw %} {% endraw %}- 💥 **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\
@@ -40,24 +46,32 @@ footer = ""
4046
conventional_commits = true
4147
filter_unconventional = true
4248
commit_parsers = [
43-
{ message = "^feat", group = "🚀 Features"},
44-
{ message = "^fix", group = "🐛 Bug Fixes"},
45-
{ message = "^docs", group = "📝 Documentation"},
46-
{ message = "^perf", group = "🏃 Performance"},
47-
{ message = "^refactor", group = "🏠 Refactor"},
48-
{ message = "^typings", group = "⌨️ Typings"},
49-
{ message = "^types", group = "⌨️ Typings"},
50-
{ message = ".*deprecated", body = ".*deprecated", group = "🚨 Deprecation"},
51-
{ message = "^revert", skip = true},
52-
{ message = "^style", group = "🪞 Styling"},
53-
{ message = "^test", group = "🧪 Testing"},
54-
{ message = "^chore", skip = true},
55-
{ message = "^ci", skip = true},
56-
{ message = "^build", skip = true},
57-
{ body = ".*security", group = "🛡️ Security"},
49+
{ message = "^feat", group = "🚀 Features" },
50+
{ message = "^fix", group = "🐛 Bug Fixes" },
51+
{ message = "^docs", group = "📝 Documentation" },
52+
{ message = "^perf", group = "🏃 Performance" },
53+
{ message = "^refactor", group = "🏠 Refactor" },
54+
{ message = "^typings", group = "⌨️ Typings" },
55+
{ message = "^types", group = "⌨️ Typings" },
56+
{ message = ".*deprecated", body = ".*deprecated", group = "🚨 Deprecation" },
57+
{ message = "^revert", skip = true },
58+
{ message = "^style", group = "🪞 Styling" },
59+
{ message = "^test", group = "🧪 Testing" },
60+
{ message = "^chore", skip = true },
61+
{ message = "^ci", skip = true },
62+
{ message = "^build", skip = true },
63+
{ body = ".*security", group = "🛡️ Security" },
64+
]
65+
commit_preprocessors = [
66+
# remove issue numbers from commits
67+
{ pattern = '\s\((\w+\s)?#([0-9]+)\)', replace = "" },
5868
]
5969
filter_commits = true
6070
tag_pattern = "v[0-9]*"
6171
ignore_tags = ""
6272
topo_order = false
6373
sort_commits = "newest"
74+
75+
[remote.github]
76+
owner = "sapphiredev"
77+
repo = "cli"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"devDependencies": {
4848
"@commitlint/cli": "^19.3.0",
4949
"@commitlint/config-conventional": "^19.2.2",
50-
"@favware/cliff-jumper": "^3.0.3",
50+
"@favware/cliff-jumper": "^4.0.2",
5151
"@favware/npm-deprecate": "^1.0.7",
5252
"@sapphire/decorators": "*",
5353
"@sapphire/eslint-config": "^5.0.5",

0 commit comments

Comments
 (0)