Skip to content

Commit

Permalink
ci: add github workflows (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomosterlund authored Jul 6, 2024
1 parent 294b2af commit 5ac2edc
Show file tree
Hide file tree
Showing 6 changed files with 7,079 additions and 1,359 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build
on:
pull_request:
paths:
- 'src/**'
- 'tsconfig.json'
- 'package.json'
- 'package-lock.json'
push:
branches:
- main

jobs:
build_library:
name: Library
runs-on: ubuntu-latest
steps:
- name: Checkout ✅
uses: actions/checkout@v4
- name: Setup Node.js 🔧
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies 🛠️
run: npm i
- name: Build
run: npm run build
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint
on:
pull_request:

jobs:
release:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout ✅
uses: actions/checkout@v4
- name: Setup Node.js 🔧
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies 🛠️
run: npm i
- name: Lint TS 🧹
run: npm run lint:ci
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
push:
branches:
- main
- 'ci/semantic_release'

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
steps:
- name: Checkout ✅
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js 🔧
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies 🛠️
run: npm ci --ignore-scripts
- name: Build 📦
run: npm run build
- name: Release 🚀
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
43 changes: 43 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"release": {
"branches": [
"main",
"ci/semantic_release"
]
},
"branches": [
"main",
"ci/semantic_release"
],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines."
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json",
"package-lock.json",
"npm-shrinkwrap.json"
],
"message": "chore(release): publish version ${nextRelease.version}"
}
],
[
"@semantic-release/github",
{
"message": "Release <%= nextRelease.version %> - <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %> [skip ci]\n\n<%= nextRelease.notes %>"
}
]
],
"dryRun": false
}
Loading

0 comments on commit 5ac2edc

Please sign in to comment.