Skip to content

Commit

Permalink
ci: update to cliff-jumper v4 and turbo v2
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jun 9, 2024
1 parent ac48314 commit 74ba3aa
Show file tree
Hide file tree
Showing 46 changed files with 1,018 additions and 380 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Continuous Delivery

on:
push:
branches:
- main

jobs:
publish:
name: Publish Next to npm
runs-on: ubuntu-latest
if: github.repository_owner == 'skyra-project'
strategy:
fail-fast: false
matrix:
package:
- env-utilities
- http-framework
- http-framework-i18n
- i18next-backend
- influx-utilities
- logger
- reddit-helpers
- safe-fetch
- shared-http-pieces
- shared-influx-pieces
- start-banner
- twitch-helpers
- weather-helpers
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Build all packages
run: yarn build
- name: Bump Versions & Publish
working-directory: packages/${{ matrix.package }}
run: |
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
yarn config set npmPublishRegistry "https://registry.yarnpkg.com"
yarn bump --preid "next.$(git rev-parse --verify --short HEAD)" --skip-changelog
yarn npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish

on:
workflow_dispatch:
inputs:
package:
description: The package to release, this should be the path segment after packages/, without the @sapphire/ prefix
required: true

jobs:
PublishPackage:
name: Publish @skyra/${{ github.event.inputs.package}}
runs-on: ubuntu-latest
if: github.repository_owner == 'skyra-project'
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
working-directory: packages/${{ github.event.inputs.package }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NPM
working-directory: packages/${{ github.event.inputs.package }}
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 }}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"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",
"@sapphire/eslint-config": "^5.0.5",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
"@swc/core": "^1.5.25",
"@types/node": "20.12.10",
"@types/node": "20.14.2",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
Expand All @@ -38,7 +38,7 @@
"lint-staged": "^15.2.5",
"prettier": "^3.3.1",
"tsup": "^8.1.0",
"turbo": "^1.13.4",
"turbo": "^2.0.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/env-utilities/.cliff-jumperrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ name: env-utilities
org: skyra
install: true
packagePath: packages/env-utilities
identifierBase: false
pushTag: true
githubRelease: true
githubReleaseLatest: true
githubRepo: skyra-project/archid-components
50 changes: 32 additions & 18 deletions packages/env-utilities/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ 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/skyra-project/archid-components/compare/{{ previous.version }}...{{ version }})\
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }})\
{% else %}\
(https://github.com/skyra-project/archid-components/tree/{{ version }})\
({{ self::remote_url() }}/tree/{{ version }})\
{% endif %}\
{% endif %} \
- ({{ timestamp | date(format="%Y-%m-%d") }})
Expand All @@ -24,7 +27,10 @@ body = """
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/skyra-project/archid-components/commit/{{ commit.id }}))\
{{ 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 }}\
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 = "@skyra/env-utilities@[0-9]*"
ignore_tags = ""
topo_order = false
sort_commits = "newest"

[remote.github]
owner = "skyra-project"
repo = "archid-components"
2 changes: 1 addition & 1 deletion packages/env-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"access": "public"
},
"devDependencies": {
"@favware/cliff-jumper": "^3.0.3",
"@favware/cliff-jumper": "^4.0.2",
"@vitest/coverage-v8": "^1.6.0",
"esbuild-plugin-version-injector": "^1.2.1",
"tsup": "^8.1.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/http-framework-i18n/.cliff-jumperrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ name: http-framework-i18n
org: skyra
install: true
packagePath: packages/http-framework-i18n
identifierBase: false
pushTag: true
githubRelease: true
githubReleaseLatest: true
githubRepo: skyra-project/archid-components
50 changes: 32 additions & 18 deletions packages/http-framework-i18n/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ 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/skyra-project/archid-components/compare/{{ previous.version }}...{{ version }})\
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }})\
{% else %}\
(https://github.com/skyra-project/archid-components/tree/{{ version }})\
({{ self::remote_url() }}/tree/{{ version }})\
{% endif %}\
{% endif %} \
- ({{ timestamp | date(format="%Y-%m-%d") }})
Expand All @@ -24,7 +27,10 @@ body = """
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/skyra-project/archid-components/commit/{{ commit.id }}))\
{{ 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 }}\
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 = "@skyra/http-framework-i18n@[0-9]*"
ignore_tags = ""
topo_order = false
sort_commits = "newest"

[remote.github]
owner = "skyra-project"
repo = "archid-components"
2 changes: 1 addition & 1 deletion packages/http-framework-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"access": "public"
},
"devDependencies": {
"@favware/cliff-jumper": "^3.0.3",
"@favware/cliff-jumper": "^4.0.2",
"tsup": "^8.1.0",
"typescript": "^5.4.5"
}
Expand Down
5 changes: 5 additions & 0 deletions packages/http-framework/.cliff-jumperrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ name: http-framework
org: skyra
install: true
packagePath: packages/http-framework
identifierBase: false
pushTag: true
githubRelease: true
githubReleaseLatest: true
githubRepo: skyra-project/archid-components
Loading

0 comments on commit 74ba3aa

Please sign in to comment.