Skip to content

Feature/upgrade prettier configuration #677

Feature/upgrade prettier configuration

Feature/upgrade prettier configuration #677

Workflow file for this run

name: build
on:
push:
branches:
- master
- /^\d+\.\d+\.\d(-alpha\.\d+|-beta\.\d+|-rc\.\d+)?$/
tags:
- "*"
pull_request:
branches:
- master
jobs:
build:
name: Test, Build & Release
runs-on: "ubuntu-latest"
env:
LOGS_DIR: /tmp/code-style/logs
LOGS_FILE: /tmp/code-style/logs/build-perf.log
NPM_VERSION: "7.x"
TZ: "Europe/Brussels"
steps:
# See: https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v2
# See: https://github.com/marketplace/actions/setup-node-js-for-use-with-actions
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: "12"
- name: Create file & folder for GitHub Actions logs
run: |
# cfr scripts/_ghactions-group.sh
mkdir -p $LOGS_DIR
touch $LOGS_FILE
- name: Get tag name if exists
id: get_tag_name
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | sed -n "s/^refs\/tags\/\(\S*\).*$/\1/p")
- name: List main variables
run: |
echo "Commit SHA : ${GITHUB_SHA}"
echo "Tag : ${GH_ACTIONS_TAG}"
echo "Reference : ${GITHUB_REF}"
echo "Repository : ${GITHUB_REPOSITORY}"
echo "Event : ${GITHUB_EVENT_NAME}"
echo "Author : ${GITHUB_ACTOR}"
NODE_VERSION="$(node -v)"
echo "Node version: $NODE_VERSION"
npm i -g npm@${NPM_VERSION}
# This ensures that we are authenticated without requiring to have an actual .npmrc file within the project
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
env:
GH_ACTIONS_TAG: ${{ steps.get_tag_name.outputs.TAG_NAME }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
- name: Build
run: npm run build
# See: https://github.com/marketplace/actions/upload-artifact
- uses: actions/upload-artifact@v1
with:
name: dist-${{ github.run_id }}
path: dist
- name: Release
run: npm run release:publish
env:
GH_ACTIONS_TAG: ${{ steps.get_tag_name.outputs.TAG_NAME }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Save logs
run: bash ./scripts/ci/print-logs.sh