Skip to content

Commit

Permalink
chore: update github actions (#78)
Browse files Browse the repository at this point in the history
* chore: update github actions

* chore: return deleted workflow

* chore: add support for prereleases

* chore: add prerelase branches to release.yml

* chore: add workflow for syncing README with code

* chore: remove commitizen

* chore: remove commitizen config

* chore: use txo configs for semantic-release and commitlint

* chore: update yarn.lock
  • Loading branch information
erik-slovak authored Oct 17, 2023
1 parent 6591981 commit 8c7cb4c
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 321 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@ on:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn lint
name: '/'
uses: technology-studio/github-workflows/.github/workflows/_code-style.yml@main
8 changes: 2 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ on:

jobs:
main:
name: Ensure semantic PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: '/'
uses: technology-studio/github-workflows/.github/workflows/_pr.yml@main
26 changes: 7 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ on:
push:
branches:
- main
- next
- next-major
- alpha
- beta

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
- run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
name: '/'
uses: technology-studio/github-workflows/.github/workflows/_release.yml@main
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:

jobs:
resolve-yarn-lock-on-comment:
name: '/'
if: contains(github.event.comment.body, '/resolve yarn.lock')
uses: technology-studio/github-workflows/.github/workflows/resolve-yarn-lock.yml@main
uses: technology-studio/github-workflows/.github/workflows/_resolve-yarn-lock.yml@main
with:
pr-number: ${{ github.event.issue.number }}
pr_number: ${{ github.event.issue.number }}
repo: ${{ github.repository }}
25 changes: 0 additions & 25 deletions .github/workflows/sync-code-in-readme.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/sync-code-in-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Embed code in README

on:
push:
branches:
- main

jobs:
embed-code:
name: '/'
uses: technology-studio/github-workflows/.github/workflows/_sync-code-in-readme.yml@main
secrets: inherit
13 changes: 2 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,5 @@ on:

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- run: yarn test --coverage
- uses: codecov/codecov-action@v3
name: '/'
uses: technology-studio/github-workflows/.github/workflows/_test.yml@main
2 changes: 1 addition & 1 deletion .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit || exec < /dev/tty && yarn cz --hook > /dev/null 2>&1 || true
yarn commitlint --edit || exec < /dev/tty && yarn txo-cz --hook > /dev/null 2>&1 || true
8 changes: 1 addition & 7 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
* @Copyright: Technology Studio
**/

const automaticCommitPattern = /^chore\(release\):.*\[skip ci]/

const commitlintConfig = {
extends: [
'@commitlint/config-conventional',
],

ignores: [
commitMsg => automaticCommitPattern.test(commitMsg),
'@txo/commitlint',
],
}

Expand Down
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,13 @@
},
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@txo-peer-dep/log": "^4.0.2",
"@txo/commitlint": "^1.0.0",
"@txo/log-console": "^3.0.0",
"@txo/semantic-release": "^1.0.0",
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"commitizen": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"concurrently": "^8.2.1",
"eslint": "^8.51.0",
"eslint-config-txo-typescript": "^3.3.33",
Expand All @@ -66,15 +63,8 @@
"lint-staged": "^15.0.1",
"npm-check-updates": "^16.14.6",
"rimraf": "^5.0.5",
"semantic-release": "^22.0.5",
"semantic-release-slack-bot": "^4.0.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
46 changes: 2 additions & 44 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,7 @@
**/

module.exports = {
branches: [
'main',
],
plugins: [
['@semantic-release/commit-analyzer', {
present: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ revert: true, release: 'patch' },
{ type: 'docs', release: 'patch' },
{ type: 'feat', release: 'minor' },
{ type: 'fix', release: 'patch' },
{ type: 'perf', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ scope: 'no-release', release: false },
],
}],
['@semantic-release/release-notes-generator', {
preset: 'conventionalcommits',
presetConfig: {
types: [
{ type: 'build', section: 'Build system / dependencies' },
{ type: 'ci', section: 'CI' },
{ type: 'docs', section: 'Documentation' },
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug fixes' },
{ type: 'perf', section: 'Performance' },
{ type: 'refactor', section: 'Refactoring' },
{ type: 'test', section: 'Testing' },
],
},
}],
['semantic-release-slack-bot',
{
notifyOnSuccess: true,
notifyOnFail: true,
},
],
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/github',
['@semantic-release/git', {
assets: ['CHANGELOG.md', 'package.json'],
}],
extends: [
'@txo/semantic-release',
],
}
Loading

0 comments on commit 8c7cb4c

Please sign in to comment.