chore(release): dialtone-icons/v4.1.1 #24
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: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- production | |
- alpha | |
- beta | |
- next | |
env: | |
HUSKY: 0 | |
jobs: | |
release: | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 18 ] | |
defaults: | |
run: | |
working-directory: ${{ github.workspace }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: parse branch from ref | |
id: branch | |
run: echo ::set-output name=BRANCH::${GITHUB_REF/refs\/heads\//} | |
# Will prevent the rest of the steps from running on fail | |
- name: Check if user is a dialpad member | |
uses: octokit/request-action@v2.1.0 | |
with: | |
route: GET /orgs/dialpad/members/${{ github.actor }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.DIALTONE_CI_TOKEN }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Set npm token | |
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.DIALTONE_NPM_TOKEN }} | |
# note that npm run build is executed before publishing via prepublishOnly | |
- name: Deploy production | |
if: ${{ github.ref == 'refs/heads/production' }} | |
run: npx nx run-many --target=release | |
- name: Deploy prerelease | |
if: ${{ github.ref != 'refs/heads/production' }} | |
run: npx nx run-many --target=release --args="--tag ${{ steps.branch.outputs.BRANCH }}" | |
- name: Set registry to github packages | |
run: npm config set @dialpad:registry https://npm.pkg.github.com | |
- name: Set github auth token | |
run: npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} | |
# note that npm run build is executed before publishing via prepublishOnly | |
- name: Deploy production to github packages | |
if: ${{ github.ref == 'refs/heads/production' }} | |
run: npx nx run-many --target=release | |
- name: Deploy ${{ steps.branch.outputs.BRANCH }} to github packages | |
if: ${{ github.ref != 'refs/heads/production' }} | |
run: npx nx run-many --target=release --args="--tag ${{ steps.branch.outputs.BRANCH }}" | |
- name: Github Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx nx run-many --target=release-github |