Skip to content

Commit 763b976

Browse files
authored
Merge pull request #32 from particle-iot/chore/sc-125799
chore: [sc-125799] Update compile-action to run on Node 20
2 parents 55496f6 + a211fc6 commit 763b976

10 files changed

+57030
-30974
lines changed

.github/workflows/check-dist.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

26-
- name: Set Node.js 18.x
27-
uses: actions/setup-node@v3.5.1
26+
- name: Set Node.js 20.x
27+
uses: actions/setup-node@v4
2828
with:
29-
node-version: 18.x
29+
node-version: 20.x
3030

3131
- name: Install dependencies
3232
run: npm ci
@@ -45,7 +45,7 @@ jobs:
4545
id: diff
4646

4747
# If index.js was different than expected, upload the expected version as an artifact
48-
- uses: actions/upload-artifact@v3
48+
- uses: actions/upload-artifact@v4
4949
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
5050
with:
5151
name: dist

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
with:
1313
ref: ${{ github.event.release.tag_name }}
14-
- uses: actions/setup-node@v3
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 18
16+
node-version: 20
1717
- run: npm ci
1818
- run: npm run build
1919
- uses: JasonEtco/build-and-tag-action@v2

.github/workflows/test.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ jobs:
55
build: # make sure build/ci work properly
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3
8+
- uses: actions/checkout@v4
99
- name: Set up Node.js
10-
uses: actions/setup-node@v3
10+
uses: actions/setup-node@v4
1111
with:
12-
node-version: 18
12+
node-version: 20
1313
- run: |
1414
npm install
1515
- run: |
@@ -20,7 +20,7 @@ jobs:
2020
os: [ ubuntu-latest ]
2121
runs-on: ${{ matrix.os }}
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- uses: ./
2525
name: 'Cloud compile'
2626
with:
@@ -33,7 +33,7 @@ jobs:
3333
os: [ ubuntu-latest ]
3434
runs-on: ${{ matrix.os }}
3535
steps:
36-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3737
with:
3838
fetch-depth: 0
3939
- name: 'Verify product version is 100'
@@ -57,7 +57,7 @@ jobs:
5757
os: [ ubuntu-latest ]
5858
runs-on: ${{ matrix.os }}
5959
steps:
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
- uses: ./
6262
name: 'Local compile'
6363
with:
@@ -69,7 +69,7 @@ jobs:
6969
platform: [ 'core', 'p1', 'photon', 'electron', 'argon', 'boron' ]
7070
runs-on: ubuntu-latest
7171
steps:
72-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
7373
- uses: ./
7474
name: 'Local compile with ino source'
7575
with:

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.14
1+
20

AUTO_VERSION.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
runs-on: ubuntu-latest
6161
steps:
6262
- name: Checkout code
63-
uses: actions/checkout@v3
63+
uses: actions/checkout@v4
6464

6565
- name: Compile application
6666
id: compile
@@ -69,7 +69,7 @@ jobs:
6969
particle-platform-name: 'boron'
7070

7171
- name: Upload artifacts
72-
uses: actions/upload-artifact@v3
72+
uses: actions/upload-artifact@v4
7373
with:
7474
path: |
7575
${{ steps.compile.outputs.firmware-path }}
@@ -107,7 +107,7 @@ jobs:
107107
runs-on: ubuntu-latest
108108
steps:
109109
- name: Checkout code
110-
uses: actions/checkout@v3
110+
uses: actions/checkout@v4
111111
with:
112112
fetch-depth: 0
113113

@@ -119,7 +119,7 @@ jobs:
119119
auto-version: true
120120

121121
- name: Upload artifacts
122-
uses: actions/upload-artifact@v3
122+
uses: actions/upload-artifact@v4
123123
with:
124124
path: |
125125
${{ steps.compile.outputs.firmware-path }}

README.md

+4-26
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Other Actions for firmware development: Compile | [Flash Device](https://github.
1111
- uses: particle-iot/compile-action@v1
1212
with:
1313
# The platform name to target the compilation
14-
# Allowed values: core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom
14+
# Allowed values: core, photon, p1, electron, argon, boron, xenon, esomx, bsom, b5som, tracker, trackerm, p2, msom, electron2
1515
# Required: true
1616
particle-platform-name: ''
1717

@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
steps:
7272
- name: Checkout code
73-
uses: actions/checkout@v3
73+
uses: actions/checkout@v4
7474
7575
- name: Compile application
7676
id: compile
@@ -79,7 +79,7 @@ jobs:
7979
particle-platform-name: 'boron'
8080
8181
- name: Upload artifact
82-
uses: actions/upload-artifact@v3
82+
uses: actions/upload-artifact@v4
8383
with:
8484
name: firmware
8585
path: |
@@ -122,29 +122,7 @@ There is no scope for cloud compilation specifically, but your access token shou
122122
If you plan to [flash firmware](https://github.com/particle-iot/flash-device-action) to test devices, it will need the `devices:update` scope.
123123
If you plan to [upload product firmware binaries](https://github.com/particle-iot/firmware-upload-action) to the cloud, it will need the `firmware:create` scope.
124124

125-
The best way to create an API user with the [API User tool](https://docs.particle.io/getting-started/cloud/cloud-api/#api-users).
126-
127-
Here's an example of how to manually create an API User for just the `compile-action`:
128-
129-
```bash
130-
# Create a new Particle access token with the `binary:compile` scope
131-
$ export TOKEN=<your Particle access token>
132-
$ export ORG_SLUG=<your Particle organization slug, visible in urls>
133-
$ curl "https://api.particle.io/v1/orgs/$ORG_SLUG/team?access_token=$TOKEN" -H "Content-Type: application/json" -d '{ "friendly_name": "GitHub Actions Compiling", "scopes": [ "binary:compile" ] }'
134-
{
135-
"ok": true,
136-
"created": {
137-
"username": "[email protected]",
138-
"is_programmatic": true,
139-
"tokens": [
140-
{
141-
"token": "9383649a07fb505c6b4ae9d5exampleexample"
142-
}
143-
]
144-
}
145-
}
146-
```
147-
125+
To create an API user, go to the Team page in your organization and click "Add API User".
148126

149127
## Known Issues
150128

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ outputs:
3737
firmware-version-updated:
3838
description: 'Boolean value indicating whether the product firmware version was updated. Can only be true with auto-version enabled.'
3939
runs:
40-
using: 'node16'
40+
using: 'node20'
4141
main: 'dist/index.js'

0 commit comments

Comments
 (0)