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

Updated Actions to only occur on certain branches #107

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 5 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on: push

jobs:
quality:
runs-on: ubuntu-latest
Expand All @@ -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"
run: pnpm build
37 changes: 18 additions & 19 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Loading