diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f25c5e1..1d22d12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,6 @@ name: CI on: push - jobs: quality: runs-on: ubuntu-latest @@ -17,39 +16,21 @@ jobs: version: latest - name: Run Biome - run: biome ci . - publish: + run: biome ci . # https://biomejs.dev/reference/cli/#biome-ci + build: + needs: quality runs-on: ubuntu-latest - permissions: - contents: read - id-token: write steps: - - name: Checkout code & submodules + - name: Checkout code uses: actions/checkout@v4 - with: - submodules: true - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: latest - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'latest' - - name: Install Dependencies run: pnpm install - name: Build Package - run: pnpm run build - - - name: "Publish to NPM" - uses: JS-DevTools/npm-publish@v3 - with: - token: ${{ secrets.NPM_TOKEN }} - access: public - - - name: "Publish to JSR" - run: "pnpm dlx jsr publish" \ No newline at end of file + run: pnpm build \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 208803d..69dffcf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,9 +1,25 @@ -name: Pull Request +name: 'Pull Request' on: pull_request jobs: + quality: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Biome + uses: biomejs/setup-biome@v1 + with: + version: latest + + - name: Run Biome + run: biome ci . # https://biomejs.dev/reference/cli/#biome-ci build: + needs: quality runs-on: ubuntu-latest steps: - name: Checkout code @@ -18,21 +34,4 @@ jobs: run: pnpm install - name: Build Package - run: pnpm build - - - name: Check if version has been updated - id: check-version-changed - uses: EndBug/version-check@v2 - with: - diff-search: true - - - name: Log when changed - if: steps.check-version-changed.outputs.changed == 'true' - run: | - echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})" - - - name: Log when unchanged - if: steps.check-version-changed.outputs.changed == 'false' - run: | - echo "No version change. Please update the package version in package.json" - exit 1 + run: pnpm build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e3b54c6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,78 @@ +name: 'Release' + +on: + release: + types: [released] + +jobs: + quality: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Biome + uses: biomejs/setup-biome@v1 + with: + version: latest + + - name: Run Biome + run: biome ci . # https://biomejs.dev/reference/cli/#biome-ci + version-check: + runs-on: ubuntu-latest + steps: + - name: Check if version has been updated + if: + id: check-version-changed + uses: EndBug/version-check@v2 + with: + diff-search: true + + - name: Log when changed + if: steps.check-version-changed.outputs.changed == 'true' + run: | + echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})" + + - name: Log when unchanged + if: steps.check-version-changed.outputs.changed == 'false' + run: | + echo "No version change. Please update the package version in package.json" + exit 1 + publish: + needs: [quality, version-check] + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout code & submodules + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'latest' + + - name: Install Dependencies + run: pnpm install + + - name: Build Package + run: pnpm run build + + - name: "Publish to NPM" + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} + access: public + + - name: "Publish to JSR" + run: "pnpm dlx jsr publish" \ No newline at end of file diff --git a/package.json b/package.json index 243388f..7cbcac4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meshtastic/js", - "version": "2.3.7-2", + "version": "2.4.3-0", "description": "Browser library for interfacing with meshtastic devices", "license": "GPL-3.0-only", "scripts": {