Skip to content

Commit 0e3ad40

Browse files
authored
Merge pull request #5 from MysteryCode/gh-actions
Overhaul GitHub Actions
2 parents ad8eba4 + d910589 commit 0e3ad40

File tree

6 files changed

+1108
-1011
lines changed

6 files changed

+1108
-1011
lines changed

.github/workflows/codestyle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
name: TS Prettier
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
- name: Set up node.js
19-
uses: actions/setup-node@v4
19+
uses: actions/setup-node@v5
2020
with:
21-
node-version: "22"
21+
node-version: "24"
2222
cache: "npm"
2323
- run: npm install
2424
- name: Run prettier

.github/workflows/javascript.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
fail-fast: false
18+
matrix:
19+
node-version:
20+
- 22
21+
- 23
22+
- 24
1823
steps:
1924
- name: Set up node.js
20-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@v5
2126
with:
22-
node-version: "22"
23-
- uses: actions/checkout@v4
27+
node-version: ${{ matrix.node-version }}
28+
- uses: actions/checkout@v5
2429
- run: echo "::add-matcher::.github/javascript-syntax.json"
2530
- name: Remove files to be ignored
2631
run: |

.github/workflows/release.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,36 @@ on:
77

88
jobs:
99
build:
10+
if: startsWith(github.ref, 'refs/tags/')
1011
runs-on: ubuntu-latest
1112
permissions:
1213
contents: write
1314
id-token: write
1415
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v5
1718
with:
18-
node-version: "22"
19+
node-version: "24"
1920
registry-url: "https://registry.npmjs.com/"
2021
- run: npm ci
22+
- name: Read package.json
23+
id: package
24+
uses: RadovanPelka/github-action-json@main
25+
with:
26+
path: "package.json"
27+
- name: Remove old builds
28+
run: |
29+
rm -rf *.tgz
2130
- name: Publish to npmjs.com
22-
if: startsWith(github.ref, 'refs/tags/')
31+
if: steps.package.outputs.private == '' || steps.package.outputs.private == 'false' || steps.package.outputs.private == false
2332
run: npm publish --provenance --access public
2433
env:
2534
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
26-
- name: Pack
27-
uses: softprops/action-gh-release@v2
28-
if: startsWith(github.ref, 'refs/tags/')
29-
with:
30-
files: "*.tar.gz"
3135
- name: Create package
32-
if: startsWith(github.ref, 'refs/tags/')
3336
run: |
34-
rm -rf *.tgz
3537
npm pack
36-
- name: Check file existence
37-
id: check_files
38-
uses: andstor/file-existence-action@v3
38+
- name: Publish to GitHub Release
39+
uses: softprops/action-gh-release@v2
3940
with:
4041
files: "*.tgz"
41-
- name: On Build Failure
42-
if: steps.check_files.outputs.files_exists == 'false'
43-
run: |
44-
echo "Packaging FAILED" && exit 1
42+
fail_on_unmatched_files: true

.github/workflows/typescript.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,30 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
fail-fast: false
18+
matrix:
19+
node-version:
20+
- 22
21+
- 23
22+
- 24
1823
steps:
19-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v5
2025
- name: Set up node.js
21-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v5
2227
with:
23-
node-version: "22"
28+
node-version: ${{ matrix.node-version }}
2429
cache: "npm"
2530
- run: npm install
2631
- run: |
2732
npx tsc --noEmit
2833
eslint:
2934
name: "eslint"
3035
runs-on: ubuntu-latest
31-
strategy:
32-
fail-fast: false
3336
steps:
34-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v5
3538
- name: Set up node.js
36-
uses: actions/setup-node@v4
39+
uses: actions/setup-node@v5
3740
with:
38-
node-version: "22"
41+
node-version: "24"
3942
cache: "npm"
4043
- run: npm install
4144
- run: npx eslint .
42-
javascript_sync:
43-
name: "Check for outdated JavaScript"
44-
needs: tsc
45-
runs-on: ubuntu-latest
46-
strategy:
47-
fail-fast: false
48-
steps:
49-
- uses: actions/checkout@v4
50-
- name: Set up node.js
51-
uses: actions/setup-node@v4
52-
with:
53-
node-version: "22"
54-
cache: "npm"
55-
- run: npm install
56-
- run: rm -R dist/**/*.js
57-
- run: |
58-
npx tsc
59-
- run: echo "::add-matcher::.github/diff.json"
60-
- name: Show diff
61-
run: |
62-
git checkout -- package-lock.json
63-
git diff --exit-code

0 commit comments

Comments
 (0)