Skip to content

Commit

Permalink
shared workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jan 22, 2023
1 parent 542a682 commit a475ce9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 123 deletions.
21 changes: 1 addition & 20 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,4 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Using Node 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Update npm version to latest
run: npm install -g npm@latest # stop showing warnings about the lockfile
- name: Install dependencies
run: |
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- name: Compile
run: npm run build
- name: Run tests
run: npm run test
uses: userscripters/shared-actions/.github/workflows/workflow-nodejs.yml@master
59 changes: 1 addition & 58 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,4 @@ on:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Using Node 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Update npm version to latest
run: npm install -g npm@latest
- name: Install dependencies
run: |
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- name: Compile
run: npm run build
- name: Run tests
run: npm run test

publish-gh:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: "https://registry.npmjs.org"
scope: "@${{github.repository_owner}}"
- run: npm install
- run: |
npm config set @${{github.repository_owner}}:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.PAT}}
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: "https://registry.npmjs.org"
scope: "@${{github.repository_owner}}"
- run: npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- run: |
npm config set @${{github.repository_owner}}:registry https://registry.npmjs.org
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
uses: userscripters/shared-actions/.github/workflows/workflow-npm_publish.yml@master
17 changes: 0 additions & 17 deletions .github/workflows/release.yml

This file was deleted.

29 changes: 1 addition & 28 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,4 @@ on:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Using Node 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Update npm version to latest
run: npm install -g npm@latest # stop showing warnings about the lockfile
- name: Install dependencies
run: |
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
npm install
env:
NODE_AUTH_TOKEN: ${{github.token}}
- name: Update to the latest minor/patch version
run: npx npm-check-updates -u --target minor
- name: Install updated dependencies & update lockfile
run: npm install && npm update
- name: Make sure everything's ok
run: npm test
- name: Push changes to GitHub
run: |
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git diff --quiet && git diff --staged --quiet || git commit -am "$(date +%F) Automated dependencies update"
git push
uses: userscripters/shared-actions/.github/workflows/workflow-update_dependencies.yml@master

0 comments on commit a475ce9

Please # to comment.