build: change gh workflow #9
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: CI | |
on: [push, pull_request] | |
env: | |
CI: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
- name: Echo versions used | |
run: echo "node:" && node --version && echo "" && echo "npm:" && npm --version && echo "" && echo "yarn:" && yarn --version | |
- name: Install dependencies | |
run: npm ci | |
- name: Run CI script | |
run: npm run ci | |
release: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
- name: Echo versions used | |
run: echo "node:" && node --version && echo "" && echo "npm:" && npm --version && echo "" && echo "yarn:" && yarn --version | |
- name: Install dependencies | |
run: npm ci | |
- name: Run build | |
run: npm run build | |
- name: Run semantic-release | |
run: npm run release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |