Skip to content

Commit 9d4a90c

Browse files
authored
Merge pull request #28 from shiftcode/#27-update-libs-and-node
feat: update Node.js version and dependencies, use rolldown, enhance configurations, fix lint issues
2 parents 622e864 + e6df3ba commit 9d4a90c

21 files changed

+22054
-35546
lines changed

.commitlintrc.yml

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

.eslintrc.yml

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

.github/workflows/test.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test typescript-action"
1+
name: 'Test typescript-action'
22
on:
33
pull_request:
44
push:
@@ -9,28 +9,47 @@ jobs:
99
test:
1010
runs-on: ubuntu-latest
1111
steps:
12+
# Checkout source
1213
- name: Checkout source
13-
uses: actions/checkout@v4.1.1
14-
- name: Install Node (v20)
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
15+
16+
# Setup Node with npm cache
17+
- name: Setup Node with npm cache
1518
id: node-install
16-
uses: actions/setup-node@v4.0.2
19+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
1720
with:
18-
node-version: 20.11
21+
node-version-file: '.nvmrc'
1922
cache: 'npm'
23+
2024
# allow packages inside this repo to consume from our private npm registry
2125
- name: Authenticate against NPM
2226
run: |
2327
npm config set //npm.pkg.github.com/:_authToken=$GH_TOKEN
2428
npm config list
2529
env:
2630
GH_TOKEN: ${{ secrets.GH_TOKEN_PKG_REGISTRY_READ }}
31+
32+
# Install dependencies
2733
- name: Install dependencies
28-
run: HUSKY=0 npm ci
34+
run: npm ci
35+
env:
36+
HUSKY: 0
37+
38+
# Check code formatting
39+
- name: 'Check code formatting'
40+
run: npm run format:ci
41+
42+
# Check code linting
43+
- name: 'Check code linting'
44+
run: npm run lint:ci
45+
46+
# Build
2947
- name: Build
3048
run: npm run build
49+
3150
- name: Check for Execution
3251
uses: ./
3352
with:
34-
skipOnCommitMsg: "sample"
53+
skipOnCommitMsg: 'sample'
3554
- name: Some Job
3655
run: echo "sample"

.husky/pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
npx lint-staged && npm run build && git add dist/*
1+
#!/bin/sh
2+
npx lint-staged && npm run build && git add dist/*

.lintstagedrc.yml

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

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
@shiftcode:registry=https://npm.pkg.github.com
1+
@shiftcode:registry=https://npm.pkg.github.com
2+
fund=false

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.11.1
1+
24

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.prettierrc.yml

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

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,35 @@ This action accepts an input string `skipOnCommitMsg` which will be used to chec
1010
If yes the output `shouldExecute` will be set to `false`. `true` otherwise. For full input / output list and other configurations check [`action.yml`](./action.yml).
1111

1212
## Example GitHub Workflow definition
13-
This example shows how to setup two dependant jobs, the second will only be executed if the output from `checkExecution` job is `false`.
13+
14+
This example shows how to set up two dependant jobs, the second will only be executed if the output from `checkExecution` job is `true`.
1415

1516
```yaml
1617
# jobs
1718
checkExecution:
18-
runs-on: ubuntu-latest
19-
outputs:
20-
shouldExecute: ${{ steps.stepCheckExecution.outputs.shouldExecute }}
21-
steps:
22-
- id: stepCheckExecution
23-
name: Check for execution
24-
uses: shiftcode/github-action-skip@releases/v2-alpha.0
25-
with:
26-
skipOnCommitMsg: "[skip_build]"
27-
githubToken: ${{secrets.GH_TOKEN_3}}
19+
runs-on: ubuntu-latest
20+
outputs:
21+
shouldExecute: ${{ steps.stepCheckExecution.outputs.shouldExecute }}
22+
steps:
23+
- id: stepCheckExecution
24+
name: Check for execution
25+
uses: shiftcode/github-action-skip@releases/v2-alpha.0
26+
with:
27+
skipOnCommitMsg: '[skip_build]'
28+
githubToken: ${{secrets.GH_TOKEN_3}}
2829
build:
29-
runs-on: ubuntu-latest
30-
needs: checkExecution
31-
# only execute if not skipped by commit message
32-
if: needs.checkExecution.outputs.shouldExecute == 'true'
33-
steps: ...
30+
runs-on: ubuntu-latest
31+
needs: checkExecution
32+
# only execute if not skipped by commit message
33+
if: needs.checkExecution.outputs.shouldExecute == 'true'
34+
steps: ...
3435
```
3536
3637
## Development
38+
3739
### new version
38-
1) implement your changes
39-
2) commit changes (pre-commit hook will do some code checks / changes and build the artifacts using ncc)
40-
3) set tag `git tag -a -m "my fancy release" v0.0.X`
41-
4) push with tags `git push --follow-tags`
40+
41+
1. implement your changes
42+
2. commit changes (pre-commit hook will do some code checks / changes and build the artifacts)
43+
3. set tag `git tag -a -m "my fancy release" v0.0.X`
44+
4. push with tags `git push --follow-tags`

0 commit comments

Comments
 (0)