Skip to content

Commit

Permalink
Reuse workflows (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhdev authored Nov 15, 2024
1 parent 26228eb commit b18beeb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 81 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,4 @@ on:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install Dependencies
run: |
npm install
- name: Lint
run: |
npm run lint
uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@4d06784788e51fa7cf79a34e4ec23283067db5a8
11 changes: 1 addition & 10 deletions .github/workflows/publish-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ANACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OFOR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#

name: Publish Dry Run

Expand All @@ -21,12 +20,4 @@ on:

jobs:
run:
name: Publish Dry Run
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: npm ci
- run: npm publish --dry-run
uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@4d06784788e51fa7cf79a34e4ec23283067db5a8
18 changes: 4 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@ on:
push:
tags: ["v*"]
jobs:
run:
name: Publish to npmjs
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
build:
uses: 8hobbies/workflows/.github/workflows/npm-publish.yml@e7fd4a1cebbdddd1747928b36f24fcba81436050
secrets:
npm-auth-token: ${{ secrets.NPM_TOKEN }}
35 changes: 1 addition & 34 deletions .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,4 @@ on:

jobs:
test:
name: Runtime
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# Only test Node 22 on Windows and MacOS
- os: macos-latest
node-version: 18.x
- os: macos-latest
node-version: 20.x
- os: windows-latest
node-version: 18.x
- os: windows-latest
node-version: 20.x

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install Dependencies
run: |
npm install
- name: Test
run: |
npm test
uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@4d06784788e51fa7cf79a34e4ec23283067db5a8

0 comments on commit b18beeb

Please sign in to comment.