Merge branch 'release/2.0.1' #7
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: Master build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
master-push: | |
name: 'Master Build' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
slack-channel: ['build-monitoring'] | |
npm-registry: ['https://registry.npmjs.org'] | |
steps: | |
- name: 'Notify build start' | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
id: slack | |
with: | |
channel: ${{ matrix.slack-channel }} | |
status: STARTED | |
color: warning | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: 'Checkout' | |
uses: actions/checkout@master | |
- name: 'Use Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v1 | |
with: | |
always-auth: true | |
node-version: ${{ matrix.node-version }} | |
- name: 'NPM Test' | |
shell: bash | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
npm config set registry ${{ matrix.npm-registry }} | |
sudo mkdir ~/.npm || true | |
sudo chown -R $USER:$GROUP ~/.npm || true | |
sudo chown -R $USER:$GROUP ~/.config || true | |
npm ci | |
npm run build | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: 'Report Coverage to Codacy' | |
uses: codacy/[email protected] | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: ./coverage/lcov.info | |
- name: 'NPM Publish' | |
shell: bash | |
run: | | |
npm publish || true | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
- name: Notify slack success | |
if: success() | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
# Updates existing message from the first step | |
message_id: ${{ steps.slack.outputs.message_id }} | |
channel: ${{ matrix.slack-channel }} | |
status: SUCCESS | |
color: good | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Notify slack fail | |
if: failure() | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
message_id: ${{ steps.slack.outputs.message_id }} | |
channel: ${{ matrix.slack-channel }} | |
status: FAILED | |
color: danger | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |