Skip to content

Commit

Permalink
ci: split deno and nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Nov 23, 2023
1 parent a3075b1 commit dd9538f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 26 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
# Check if it works with current versions
# Check if it works with current deno version
- cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC

jobs:
Expand All @@ -30,28 +30,3 @@ jobs:
- run: deno cache source/*.ts
- run: deno check source/*.ts
- run: deno test

nodejs:
name: Node.js
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm test
- run: npm pack
- run: npm publish
if: startsWith(github.ref, 'refs/tags/v')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_ACCESS: public
NPM_CONFIG_PROVENANCE: true
- name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
44 changes: 44 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node.js

on:
push:
pull_request:
schedule:
# Check if it works with current dependencies
- cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC

jobs:
test:
name: Node.js
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: actions/checkout@v4
- run: npm install
- run: npm test
- run: npm pack

publish:
name: Publish on NPM
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_ACCESS: public
NPM_CONFIG_PROVENANCE: true
- name: Create GitHub release
uses: softprops/action-gh-release@v1

0 comments on commit dd9538f

Please sign in to comment.