Skip to content

Release NPM Packages #162

Release NPM Packages

Release NPM Packages #162

name: Release NPM Packages
on:
workflow_dispatch:
# schedule:
# - cron: '0 7 * * 0-4'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SERVICE_USER: "Microsoft FAST Builds"
GITHUB_SERVICE_EMAIL: "[email protected]"
jobs:
build_linux:
runs-on: ubuntu-latest
strategy:
matrix:
node: [20.x]
if: contains('chrisdholt,janechu', github.actor)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Set Git User
run: |
git config --global user.name "${{ env.GITHUB_SERVICE_USER }}"
git config --global user.email "${{ env.GITHUB_SERVICE_EMAIL }}"
- name: Cache multiple paths
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install package dependencies / prepare workspaces
run: npm ci
- name: Check for the presence of changed files inside ./change
run: npm run checkchange
- name: Testing Prettier format
run: npm run format:check
- name: Build workspaces
run: npm run build
- name: Install playwright dependencies and browsers
run: |
npx playwright install
- name: Testing unit tests
run: npm run test
- name: Testing final validation
run: npm run test:validation
- name: Publish NPM packages
env:
NPM_SECRET_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run publish-ci -n $NPM_SECRET_TOKEN
notify:
runs-on: ubuntu-latest
needs: build_linux
steps:
- name: Notify on Discord
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_NOTIFICATION_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_NOTIFICATION_WEBHOOK_TOKEN }}
color: '#DE2D6D'
username: 'FAST DevOps Packages Bot'
message: 'Release has published to NPM on https://github.com/microsoft/fast/actions/workflows/cd-release-npm.yml'