Fix/remove event #295
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RPG CI | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm i | |
- run: npm test | |
build_and_publish: | |
needs: tests | |
if: github.ref == 'refs/heads/v4' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'npm' | |
- run: npm i | |
- run: npm run build | |
- name: "Version and publish" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor}}@users.noreply.github.com" | |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN | |
npx lerna version --conventional-commits --no-push --yes | |
npx lerna publish from-git --no-private --loglevel=verbose --yes | |
starter_repo_update_dependencies: | |
needs: build_and_publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the starter repository | |
run: git clone https://github.com/rpgjs/starter | |
- name: Change to the starter directory | |
run: cd starter | |
- name: Install npm-check-updates globally | |
run: npm i npm-check-updates -g | |
- name: Run ncu to update dependencies | |
run: ncu -u | |
- run: npm i | |
- name: Configure Git User | |
run: | | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor}}@users.noreply.github.com" | |
- name: Commit the updated package.json | |
run: | | |
git add package*.json | |
git commit -m "Update dependencies to latest version" | |
git push https://[email protected]/rpgjs/starter.git |