Skip to content

Release

Release #94

Workflow file for this run

name: Release
on: workflow_dispatch
concurrency:
cancel-in-progress: true
group: release-${{ github.ref }}
jobs:
release:
if: github.ref == 'refs/heads/master'
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20.3.1
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Set git
run: |
git config --global user.name "${NAME}"
git config --global user.email "${EMAIL}"
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
- name: Build
run: yarn build
- name: Versionning code
run: GH_TOKEN=${GITHUB_TOKEN} yarn lerna version --force-publish --yes --conventional-commits --create-release github
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
- name: Setup token
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy to npm
run: yarn lerna publish from-package --yes
- name: Remove .npmrc
if: always()
run: rm .npmrc