Skip to content

Commit

Permalink
fix(ci): Upgrade to github-script@v7
Browse files Browse the repository at this point in the history
* Also adjust form @actions/upload API changes.
  • Loading branch information
petejohanson committed Dec 13, 2023
1 parent ff57ccc commit 52ed49b
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ jobs:
- name: Install @actions/artifact
run: npm install @actions/artifact
- name: Build and upload artifacts
uses: actions/github-script@v4
uses: actions/github-script@v7
id: boards-list
with:
script: |
const fs = require('fs');
const artifact = require('@actions/artifact');
const artifactClient = artifact.create();
const {default: artifact} = require('@actions/artifact');
const execSync = require('child_process').execSync;
Expand Down Expand Up @@ -90,7 +89,7 @@ jobs:
const cmakeName = shieldArgs['cmake-args'] ? '-' + (shieldArgs.nickname || shieldArgs['cmake-args'].split(' ').join('')) : '';
const artifactName = `${{ matrix.board }}${shieldArgs.shield ? '-' + shieldArgs.shield : ''}${cmakeName}-zmk`;
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
await artifact.uploadArtifact(artifactName, files, rootDirectory, options);
} catch (e) {
console.error(`::error::Failed to build or upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
console.error(e);
Expand All @@ -111,7 +110,7 @@ jobs:
include-list: ${{ steps.compile-list.outputs.result }}
steps:
- name: Join build lists
uses: actions/github-script@v4
uses: actions/github-script@v7
id: compile-list
with:
script: |
Expand Down Expand Up @@ -158,7 +157,7 @@ jobs:
node-version: "14.x"
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: core-list
with:
script: |
Expand Down Expand Up @@ -187,7 +186,7 @@ jobs:
node-version: "14.x"
- name: Install js-yaml
run: npm install js-yaml
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: boards-list
with:
script: |
Expand Down Expand Up @@ -264,7 +263,7 @@ jobs:
nightly-include: ${{ steps.nightly-list.outputs.result }}
steps:
- name: Create nightly list
uses: actions/github-script@v4
uses: actions/github-script@v7
id: nightly-list
with:
script: |
Expand Down Expand Up @@ -315,7 +314,7 @@ jobs:
- name: Install js-yaml
run: npm install js-yaml
- name: Aggregate Metadata
uses: actions/github-script@v4
uses: actions/github-script@v7
id: aggregate-metadata
with:
script: |
Expand All @@ -333,7 +332,7 @@ jobs:
result-encoding: string

- name: Organize Metadata
uses: actions/github-script@v4
uses: actions/github-script@v7
id: organize-metadata
with:
script: |
Expand Down Expand Up @@ -390,15 +389,15 @@ jobs:
id: changed-files
with:
format: "json"
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: board-changes
with:
script: |
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
return boardChanges.length ? 'true' : 'false';
result-encoding: string
- uses: actions/github-script@v4
- uses: actions/github-script@v7
id: core-changes
with:
script: |
Expand Down

0 comments on commit 52ed49b

Please sign in to comment.