chore: upgrade pull_request GitHub actions workflow to node 18 #166
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: build | |
on: | |
- push | |
- workflow_dispatch | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: npm install | |
lint: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: npm install | |
- run: npm run lint | |
verify-api: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: npm install | |
- run: npm run check-missing-api | |
test: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: npm install | |
- run: npm run build:lib | |
- run: npm run test:ci | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: tests-coverage | |
path: coverage/ | |
if-no-files-found: error | |
- uses: coverallsapp/github-action@v2 | |
with: | |
file: ./coverage/ngx-matomo-client/lcov.info | |
flag-name: ngx-matomo-client | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-npm: | |
needs: [lint, test, verify-api] | |
runs-on: ubuntu-latest | |
env: | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- run: echo -n "${GPG_SECRET_KEY}" > git_gpg_key.asc | |
- run: gpg --batch --yes --import git_gpg_key.asc | |
- run: git config user.name ${GIT_AUTHOR_NAME} | |
- run: git config user.email ${GIT_AUTHOR_EMAIL} | |
- run: git config commit.gpgsign true | |
- run: git config --global user.signingkey ${GPG_KEY_ID} | |
- run: npm install | |
- run: npm run build:prod:lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist-prod | |
path: dist-prod | |
if-no-files-found: error | |
- run: npm run semantic-release:ci | |
env: | |
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} |