Skip to content

release

release #233

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
releaseAs:
type: choice
description: Release Version Type
options:
- patch
- minor
- major
- premajor
- preminor
- prepatch
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.DEPLOY_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Check npm credentials
run: npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Git
run: |
git config user.name "GitHub Bot"
git config user.email "[email protected]"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Version
shell: bash
run: yarn nx run-many --target=version --all --parallel=1 --push --allowEmptyRelease --releaseAs=$RELEASE_AS
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_AS: ${{ github.event.inputs.releaseAs }}
HUSKY: 0
- name: Commit Release
shell: bash
run: |
git commit -m "chore: release versions"
- name: Push to protected branch
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.DEPLOY_TOKEN }}
branch: main
unprotect_reviews: false
env:
HUSKY: 0