diff --git a/.changeset/calm-queens-own.md b/.changeset/calm-queens-own.md new file mode 100644 index 0000000..500d3bf --- /dev/null +++ b/.changeset/calm-queens-own.md @@ -0,0 +1,5 @@ +--- +"@intentface/react-speech-recognition": patch +--- + +Added github workflows diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..19448b6 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2cfe231 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/package.json b/package.json index a334372..6022671 100644 --- a/package.json +++ b/package.json @@ -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" },