Skip to content

Commit 5667663

Browse files
committed
Merge upstream/main to refresh flash core and keep Spectoda example app
Bring Spectoda/flash up to the current upstream esptool-js 0.6.0 state so the underlying flashing logic, chip targets, reset handling, transport changes, and stub flasher assets match the latest upstream implementation. Resolve the example-layer conflicts by keeping the Spectoda-branded flashing UI, the preloaded firmware flow, and the parent-window integration on top of the updated core. Add the missing examples/typescript/static/fw placeholder structure so the example build no longer fails when the static firmware directory is absent in a clean checkout. Impact: the fork is now up to date in the code paths that perform flashing, while the Spectoda wrapper remains intact. Verified with npm run build in the repository root and npm run build in examples/typescript.
2 parents ba37375 + 9de1d0d commit 5667663

55 files changed

Lines changed: 5287 additions & 1721 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: CI
2+
13
on:
24
push:
35
branches:
@@ -10,8 +12,8 @@ jobs:
1012
ci:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
1517
with:
1618
node-version: 16
1719
registry-url: 'https://registry.npmjs.org'
@@ -30,7 +32,7 @@ jobs:
3032
echo $ESPTOOLJS_VERSION
3133
echo "version=$ESPTOOLJS_VERSION" >> $GITHUB_OUTPUT
3234
- name: Upload npm package file
33-
uses: actions/upload-artifact@v1
35+
uses: actions/upload-artifact@v4
3436
with:
3537
name: esptool-js-${{ steps.version.outputs.version }}.tgz
3638
path: esptool-js-${{ steps.version.outputs.version }}.tgz

.github/workflows/pages.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,26 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
- name: Set up Node
30-
uses: actions/setup-node@v3
30+
uses: actions/setup-node@v4
3131
with:
32-
node-version: 18
32+
node-version: 20
3333
- name: Install Node modules
3434
run: |
3535
npm install
3636
- name: Build example project and copy docs
3737
run: |
3838
npm run build
39-
npm run genDocs
4039
cd examples/typescript
4140
npm install
4241
npm run build
4342
- name: Setup Pages
4443
uses: actions/configure-pages@v2
4544
- name: Upload artifact
46-
uses: actions/upload-pages-artifact@v1
45+
uses: actions/upload-pages-artifact@v3
4746
with:
4847
path: 'examples/typescript/dist'
4948
- name: Deploy to GitHub Pages
5049
id: deployment
51-
uses: actions/deploy-pages@v1
50+
uses: actions/deploy-pages@v4

.github/workflows/pr_comment.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Comment on pull request
2+
on:
3+
workflow_run:
4+
workflows: [CI]
5+
types: [completed]
6+
jobs:
7+
pr_comment:
8+
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/github-script@v6
12+
with:
13+
# This snippet is public-domain, taken from
14+
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
15+
script: |
16+
async function upsertComment(owner, repo, issue_number, purpose, body) {
17+
const {data: comments} = await github.rest.issues.listComments(
18+
{owner, repo, issue_number});
19+
20+
const marker = `<!-- bot: ${purpose} -->`;
21+
body = marker + "\n" + body;
22+
23+
const existing = comments.filter((c) => c.body.includes(marker));
24+
if (existing.length > 0) {
25+
const last = existing[existing.length - 1];
26+
core.info(`Updating comment ${last.id}`);
27+
await github.rest.issues.updateComment({
28+
owner, repo,
29+
body,
30+
comment_id: last.id,
31+
});
32+
} else {
33+
core.info(`Creating a comment in issue / PR #${issue_number}`);
34+
await github.rest.issues.createComment({issue_number, body, owner, repo});
35+
}
36+
}
37+
38+
const {owner, repo} = context.repo;
39+
const run_id = ${{github.event.workflow_run.id}};
40+
41+
const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
42+
if (!pull_requests.length) {
43+
return core.error("This workflow doesn't match any pull requests!");
44+
}
45+
46+
const artifacts = await github.paginate(
47+
github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
48+
if (!artifacts.length) {
49+
return core.error(`No artifacts found`);
50+
}
51+
let body = `Download the artifacts for this pull request:\n`;
52+
for (const art of artifacts) {
53+
body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
54+
}
55+
56+
core.info("Review thread message body:", body);
57+
58+
for (const pr of pull_requests) {
59+
await upsertComment(owner, repo, pr.number,
60+
"nightly-link", body);
61+
}

.github/workflows/publish.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ on:
33
tags:
44
- "v*"
55

6+
permissions:
7+
id-token: write # Required for OIDC
8+
contents: write
9+
610
jobs:
711
publish:
812
runs-on: ubuntu-latest
913
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v6
15+
- uses: actions/setup-node@v6
1216
with:
13-
node-version: 16
17+
node-version: '24'
1418
registry-url: "https://registry.npmjs.org"
1519
- name: Install dependencies and build 🔧
1620
run: npm ci && npm run build
@@ -26,18 +30,14 @@ jobs:
2630
[ ${GITHUB_REF:11} = $(node -p "require('./package.json').version") ]
2731
echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
2832
- name: Upload package file
29-
uses: actions/upload-artifact@v1
33+
uses: actions/upload-artifact@v7
3034
with:
3135
name: esptool-js-${{ steps.version.outputs.version }}.tgz
3236
path: esptool-js-${{ steps.version.outputs.version }}.tgz
33-
- name: Create Release
34-
id: create_release
35-
uses: actions/create-release@v1.0.0
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- uses: ncipollo/release-action@v1
3838
with:
39-
tag_name: ${{ github.ref }}
40-
release_name: Espressif ESPTOOL-JS ${{ github.ref }}
39+
artifacts: "./esptool-js-${{ steps.version.outputs.version }}.tgz"
40+
name: Espressif ESPTOOL-JS ${{ github.ref }}
4141
draft: true
4242
body: |
4343
### Release Highlights
@@ -49,17 +49,5 @@ jobs:
4949
### Bug Fixes
5050
5151
<!-- Insert The Bug Fixes below as points, also add relevant links -->
52-
- name: Upload release
53-
id: upload-release-asset
54-
uses: actions/upload-release-asset@v1.0.1
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_path: ./esptool-js-${{ steps.version.outputs.version }}.tgz
60-
asset_name: esptool-js-${{ steps.version.outputs.version }}.tgz
61-
asset_content_type: application/zip
6252
- name: Publish package on NPM 📦
6353
run: npm publish
64-
env:
65-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)