Skip to content

Release

Release #19

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: 'View list of files that will be published before the real release'
required: true
default: 'true' ## Dry run
release:
# This specifies that the build will be triggered when we publish a release
types: [published]
jobs:
build:
name: Build Blackprint Modules
runs-on: ubuntu-latest
timeout-minutes: 5 # Usually this will be finish under 5 minutes
steps:
- uses: actions/checkout@v3
- name: ⚙ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: 🔃 Setup PNPM modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 6.0.2
run_install: true
- name: 🛠 Compiling Blackprint Modules
run: npx blackprint build production
- run: npm version ${{ github.event.release.tag_name }}
- name: 🔥 Run Tests
# env:
# YOUR_ENV_A: ${{ secrets.YOUR_ENV_A }}
# YOUR_ENV_B: ${{ secrets.YOUR_ENV_B }}
run: npm test
- name: 📦 Dry Run
if: github.event.inputs.dryRun == 'true'
run: npm publish --dry-run
# If you want to publish to NPM, make sure to put your NPM token to repository settings
- name: 📦 Publish Packages
if: github.event.inputs.dryRun != 'true'
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}