Skip to content

Commit

Permalink
Update CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
evanplaice committed Aug 22, 2024
1 parent 1dc4c90 commit c1b4e98
Show file tree
Hide file tree
Showing 6 changed files with 5,606 additions and 79 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
name: Latest

on:
on:
push:
branches:
- main
tags-ignore:
- 'v*'
pull_request:
paths-ignore:
- package.json
- package-lock.json

jobs:
verify:
name: Verify
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Install
run: npm i
- name: Test
run: npm t
- name: Lint
run: npm run lint
- name: Types
run: npm run types
ci:
uses: vanillaes/.github/.github/workflows/verify.yml@main

7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Pull Request

on: [pull_request]

jobs:
ci:
uses: vanillaes/.github/.github/workflows/verify.yml@main
57 changes: 12 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,15 @@ on:
- 'v*'

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14, 16]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Verify
run: |
npm i
npm run preversion
npm:
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
npm publish --access public
gh:
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Publish
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
ORG="$(echo '${{ github.repository }}' | cut -d'/' -f1)"
echo "registry=https://npm.pkg.github.com/$ORG" > .npmrc
npm publish
ci:
uses: vanillaes/.github/.github/workflows/verify.yml@main

cd-npm:
needs: ci
uses: vanillaes/.github/.github/workflows/npm.yml@main
secrets: inherit

cd-gh:
needs: ci
uses: vanillaes/.github/.github/workflows/gh.yml@main
secrets: inherit
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ node_modules/
package/
.DS_Store
*.tgz
package-lock.json
Loading

0 comments on commit c1b4e98

Please sign in to comment.