Skip to content

Commit 13baf6d

Browse files
author
David Buzinski
committed
update ts module type and jest config
1 parent 56f95cf commit 13baf6d

15 files changed

Lines changed: 358 additions & 341 deletions

.github/workflows/bat.yml

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
1-
name: Build and Test
2-
on: [push]
3-
permissions:
4-
contents: read
5-
6-
jobs:
7-
plugin-tests:
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
include:
13-
- os: ubuntu-latest
14-
- os: windows-latest
15-
- os: macos-latest
16-
steps:
17-
- uses: actions/checkout@v5
18-
- uses: matlab-actions/setup-matlab@v2
19-
with:
20-
release: latest-including-prerelease
21-
- uses: matlab-actions/run-tests@v2
22-
23-
bat:
24-
name: Build and Test
25-
runs-on: ubuntu-22.04
26-
steps:
27-
- uses: actions/checkout@v5
28-
- uses: actions/setup-node@v5
29-
with:
30-
node-version: 20
31-
- name: Perform npm tasks
32-
run: npm run ci
33-
1+
name: Build and Test
2+
on: [push]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
bat:
9+
name: Build and Test
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-node@v6
14+
with:
15+
node-version: 24
16+
- name: Perform npm tasks
17+
run: npm run ci

.github/workflows/publish.yml

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
name: Publish
2-
on:
3-
release:
4-
types: published
5-
permissions:
6-
contents: write
7-
8-
jobs:
9-
build:
10-
name: Build
11-
runs-on: ubuntu-latest
12-
outputs:
13-
tag: ${{ steps.update-package-version.outputs.version }}
14-
steps:
15-
- uses: actions/checkout@v5
16-
- name: Configure git
17-
run: |
18-
git config user.name 'Release Action'
19-
git config user.email '<>'
20-
- uses: actions/setup-node@v5
21-
with:
22-
node-version: 20
23-
24-
# Call `npm version`. It increments the version and commits the changes.
25-
# We'll save the output (new version string) for use in the following
26-
# steps
27-
- name: Update package version
28-
id: update-package-version
29-
run: |
30-
git tag -d "${{ github.event.release.tag_name }}"
31-
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
32-
git add package.json package-lock.json
33-
git commit -m "[skip ci] Bump $VERSION"
34-
git push origin HEAD:main
35-
36-
# Now carry on, business as usual
37-
- name: Perform npm tasks
38-
run: npm run ci
39-
40-
# Finally, create a detached commit containing the built artifacts and tag
41-
# it with the release. Note: the fact that the branch is locally updated
42-
# will not be relayed (pushed) to origin
43-
- name: Commit to release branch
44-
id: release_info
45-
run: |
46-
# Check for semantic versioning
47-
longVersion="${{github.event.release.tag_name}}"
48-
echo "Preparing release for version $longVersion"
49-
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
50-
majorVersion=$(echo ${longVersion%.*.*})
51-
minorVersion=$(echo ${longVersion%.*})
52-
53-
# Add the built artifacts. Using --force because dist/lib should be in
54-
# .gitignore
55-
git add --force dist lib
56-
57-
# Make the commit
58-
MESSAGE="Build for $(git rev-parse --short HEAD)"
59-
git commit --allow-empty -m "$MESSAGE"
60-
git tag -f -a -m "Release $longVersion" $longVersion
61-
62-
# Get the commit of the tag you just released
63-
commitHash=$(git rev-list -n 1 $longVersion)
64-
65-
# Delete the old major and minor version tags locally
66-
git tag -d $majorVersion || true
67-
git tag -d $minorVersion || true
68-
69-
# Make new major and minor version tags locally that point to the commit you got from the "git rev-list" above
70-
git tag -f $majorVersion $commitHash
71-
git tag -f $minorVersion $commitHash
72-
73-
# Force push the new minor version tag to overwrite the old tag remotely
74-
echo "Pushing new tags"
75-
git push -f origin $longVersion
76-
git push -f origin $majorVersion
77-
git push -f origin $minorVersion
1+
name: Publish
2+
on:
3+
release:
4+
types: published
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
outputs:
13+
tag: ${{ steps.update-package-version.outputs.version }}
14+
steps:
15+
- uses: actions/checkout@v6
16+
- name: Configure git
17+
run: |
18+
git config user.name 'Release Action'
19+
git config user.email '<>'
20+
- uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
23+
24+
# Call `npm version`. It increments the version and commits the changes.
25+
# We'll save the output (new version string) for use in the following
26+
# steps
27+
- name: Update package version
28+
id: update-package-version
29+
run: |
30+
git tag -d "${{ github.event.release.tag_name }}"
31+
VERSION=$(npm version "${{ github.event.release.tag_name }}" --no-git-tag-version)
32+
git add package.json package-lock.json
33+
git commit -m "[skip ci] Bump $VERSION"
34+
git push origin HEAD:main
35+
36+
# Now carry on, business as usual
37+
- name: Perform npm tasks
38+
run: npm run ci
39+
40+
# Finally, create a detached commit containing the built artifacts and tag
41+
# it with the release. Note: the fact that the branch is locally updated
42+
# will not be relayed (pushed) to origin
43+
- name: Commit to release branch
44+
id: release_info
45+
run: |
46+
# Check for semantic versioning
47+
longVersion="${{github.event.release.tag_name}}"
48+
echo "Preparing release for version $longVersion"
49+
[[ $longVersion == v[0-9]*.[0-9]*.[0-9]* ]] || (echo "must follow semantic versioning" && exit 1)
50+
majorVersion=$(echo ${longVersion%.*.*})
51+
minorVersion=$(echo ${longVersion%.*})
52+
53+
# Add the built artifacts. Using --force because dist/lib should be in
54+
# .gitignore
55+
git add --force dist lib
56+
57+
# Make the commit
58+
MESSAGE="Build for $(git rev-parse --short HEAD)"
59+
git commit --allow-empty -m "$MESSAGE"
60+
git tag -f -a -m "Release $longVersion" $longVersion
61+
62+
# Get the commit of the tag you just released
63+
commitHash=$(git rev-list -n 1 $longVersion)
64+
65+
# Delete the old major and minor version tags locally
66+
git tag -d $majorVersion || true
67+
git tag -d $minorVersion || true
68+
69+
# Make new major and minor version tags locally that point to the commit you got from the "git rev-list" above
70+
git tag -f $majorVersion $commitHash
71+
git tag -f $minorVersion $commitHash
72+
73+
# Force push the new minor version tag to overwrite the old tag remotely
74+
echo "Pushing new tags"
75+
git push -f origin $longVersion
76+
git push -f origin $majorVersion
77+
git push -f origin $minorVersion

jest.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

jest.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
testEnvironment: "node",
3+
collectCoverage: true,
4+
testMatch: ["**/*.test.ts"],
5+
transform: {
6+
"^.+\\.[jt]s$": [
7+
"ts-jest",
8+
{
9+
diagnostics: {
10+
ignoreCodes: [151002],
11+
},
12+
},
13+
],
14+
},
15+
transformIgnorePatterns: ["node_modules/(?!(@actions)/)"],
16+
moduleNameMapper: {
17+
"^(\\.{1,2}/.*)\\.js$": "$1",
18+
"^@actions/core$": "<rootDir>/node_modules/@actions/core/lib/core.js",
19+
"^@actions/exec$": "<rootDir>/node_modules/@actions/exec/lib/exec.js",
20+
},
21+
};

0 commit comments

Comments
 (0)