Skip to content

Commit

Permalink
Merge pull request #1 from Intentface/latenssi/add-github-workflows
Browse files Browse the repository at this point in the history
Add github workflows
  • Loading branch information
latenssi authored Sep 5, 2024
2 parents b85c9a2 + 3eff93a commit c848e9a
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-queens-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@intentface/react-speech-recognition": patch
---

Added github workflows
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- run: npm i
- run: npm run lint && npm run build
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"

- run: npm i
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup index.ts --format cjs,esm --dts",
"add-change": "changeset add",
"release": "npm run build && changeset publish",
"lint": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down

0 comments on commit c848e9a

Please sign in to comment.