Skip to content

Commit 3cbbc37

Browse files
committed
update as per common-utils change
2 parents 82b7c64 + d44fc9f commit 3cbbc37

8 files changed

Lines changed: 1811 additions & 643 deletions

File tree

.github/workflows/bat.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
11
name: Build and Test
22
on: [push]
3+
permissions:
4+
contents: read
35

46
jobs:
57
bat:
68
name: Build and Test
79
runs-on: ubuntu-latest
810
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v4
11+
- uses: actions/checkout@v5
12+
- uses: actions/setup-node@v5
1113
with:
1214
node-version: "20"
1315
- name: Perform npm tasks
1416
run: npm run ci
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: built-action
20+
path: |
21+
**/*
22+
!node_modules/
23+
integ:
24+
needs: bat
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
30+
steps:
31+
- uses: actions/download-artifact@v5
32+
with:
33+
name: built-action
1534

1635
- name: Perform 'setup-matlab'
1736
uses: matlab-actions/setup-matlab@v2
1837
with:
1938
products: MATLAB_Test
2039

2140
- name: Create buildfile.m in project root for tests
41+
shell: bash
2242
run: |
2343
cat <<'_EOF' >> "buildfile.m"
2444
function plan = buildfile
@@ -68,6 +88,7 @@ jobs:
6888
uses: ./
6989

7090
- name: Verify correct tasks appear in buildlog.txt
91+
shell: bash
7192
run: |
7293
set -e
7394
grep "building" buildlog.txt
@@ -84,6 +105,7 @@ jobs:
84105
tasks: deploy
85106

86107
- name: Verify correct tasks appear in buildlog.txt
108+
shell: bash
87109
run: |
88110
set -e
89111
grep "building" buildlog.txt
@@ -100,6 +122,7 @@ jobs:
100122
tasks: deploy check
101123

102124
- name: Verify correct tasks appear in buildlog.txt
125+
shell: bash
103126
run: |
104127
set -e
105128
grep "building" buildlog.txt
@@ -114,8 +137,9 @@ jobs:
114137
uses: ./
115138
with:
116139
tasks: test("myTests", OutputDetail="concise")
117-
140+
118141
- name: Verify correct tasks appear in buildlog.txt
142+
shell: bash
119143
run: |
120144
set -e
121145
grep "building" buildlog.txt
@@ -132,6 +156,7 @@ jobs:
132156
startup-options: -logfile console.log
133157

134158
- name: Verify tasks appear in buildlog.txt and console.log
159+
shell: bash
135160
run: |
136161
set -e
137162
grep "building" buildlog.txt
@@ -152,8 +177,9 @@ jobs:
152177
with:
153178
tasks: deploy
154179
build-options: -skip test
155-
180+
156181
- name: Verify correct tasks appear in buildlog.txt
182+
shell: bash
157183
run: |
158184
set -e
159185
grep "building" buildlog.txt
@@ -163,15 +189,16 @@ jobs:
163189
grep "deploying" buildlog.txt
164190
! grep "checking" buildlog.txt
165191
rm buildlog.txt
166-
192+
167193
- name: Run build with continue on failure
168194
continue-on-error: true
169195
uses: ./
170196
with:
171197
tasks: error deploy
172198
build-options: -continueOnFailure
173-
199+
174200
- name: Verify correct tasks appear in buildlog.txt
201+
shell: bash
175202
run: |
176203
set -e
177204
grep "erroring" buildlog.txt
@@ -192,6 +219,7 @@ jobs:
192219
startup-options: -logfile console.log
193220

194221
- name: Verify workflow command is added
222+
shell: bash
195223
run: |
196224
grep "::group::deploy" console.log
197225
grep "::error::error task failed" console.log
@@ -211,8 +239,9 @@ jobs:
211239
startup-options: -logfile console.log
212240

213241
- name: Verify summary exception for invalid task
242+
shell: bash
214243
run: |
215244
set -e
216245
! grep "while reading the build summary file:" console.log
217246
! grep "trying to delete the build summary" console.log
218-
rm console.log
247+
rm console.log

.github/workflows/publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Publish
2-
32
on:
43
release:
5-
types: [published, edited]
4+
types: published
5+
permissions:
6+
contents: write
67

78
jobs:
89
build:
@@ -11,18 +12,15 @@ jobs:
1112
outputs:
1213
tag: ${{ steps.update-package-version.outputs.version }}
1314
steps:
14-
# Configure runner with the right stuff
15-
- uses: actions/checkout@v4
16-
with:
17-
token: ${{ secrets.GITHUB_TOKEN }}
15+
- uses: actions/checkout@v5
1816
- name: Configure git
1917
run: |
2018
git config user.name 'Release Action'
2119
git config user.email '<>'
22-
- uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v5
2321
with:
24-
node-version: "20"
25-
22+
node-version: 20
23+
2624
# Call `npm version`. It increments the version and commits the changes.
2725
# We'll save the output (new version string) for use in the following
2826
# steps
@@ -31,7 +29,6 @@ jobs:
3129
run: |
3230
git tag -d "${{ github.event.release.tag_name }}"
3331
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
34-
echo "::set-output name=version::$VERSION"
3532
git add package.json package-lock.json
3633
git commit -m "[skip ci] Bump $VERSION"
3734
git push origin HEAD:main
@@ -47,18 +44,21 @@ jobs:
4744
id: release_info
4845
run: |
4946
# Check for semantic versioning
50-
echo "Preparing release for version $longVersion"
5147
longVersion="${{github.event.release.tag_name}}"
48+
echo "Preparing release for version $longVersion"
5249
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
5350
majorVersion=$(echo ${longVersion%.*.*})
5451
minorVersion=$(echo ${longVersion%.*})
52+
5553
# Add the built artifacts. Using --force because dist/lib should be in
5654
# .gitignore
5755
git add --force dist lib
56+
5857
# Make the commit
5958
MESSAGE="Build for $(git rev-parse --short HEAD)"
6059
git commit --allow-empty -m "$MESSAGE"
6160
git tag -f -a -m "Release $longVersion" $longVersion
61+
6262
# Get the commit of the tag you just released
6363
commitHash=$(git rev-list -n 1 $longVersion)
6464

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,9 @@ Input | Description
9595
- [Action for Setting Up MATLAB](https://github.com/matlab-actions/setup-matlab/)
9696
- [Continuous Integration with MATLAB and Simulink](https://www.mathworks.com/solutions/continuous-integration.html)
9797

98-
## Contact Us
99-
If you have any questions or suggestions, contact MathWorks&reg; at [continuous-integration@mathworks.com](mailto:continuous-integration@mathworks.com).
98+
## Feedback and Support
99+
If you encounter a product licensing issue, consider requesting a MATLAB batch licensing token to use in your workflow. For more information, see [Use MATLAB Batch Licensing Token](#use-matlab-batch-licensing-token).
100+
101+
If you have an enhancement request or other feedback about this action, create an issue on the [Issues](https://github.com/matlab-actions/run-build/issues) page.
102+
103+
For support, contact [MathWorks Technical Support](https://www.mathworks.com/support/contact_us.html).

0 commit comments

Comments
 (0)