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

Add Semantic-Release, Update Actions #3

Merged
merged 1 commit into from
Mar 10, 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
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@commitlint/config-conventional"
}
4 changes: 2 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
21 changes: 8 additions & 13 deletions .github/workflows/automated-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Automated Tests

on:
push:
branches: [main, develop]
Expand All @@ -13,20 +14,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4.1.1
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Use Node.js
- name: 📥 Check out repository
uses: actions/checkout@v4
- name: 📜 Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies and run tests
run: |
npm install
npm run lint
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: 🔗 Install dependencies
run: npm install
- name: 🧹 Lint
run: npm run lint
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches: [main, develop]

permissions:
contents: read

jobs:
release:
name: Release
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

steps:
- name: 📥 Check out repository
uses: actions/checkout@v4
- name: 📜 Use Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: 🔗 Install dependencies
run: npx ci
- name: 🧩 Install semantic-release extra plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
- name: 🧹 Lint
run: npm run lint:fix
- name: ✅ Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npx --no -- commitlint --edit "$1"
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npx lint-staged
21 changes: 21 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Loading