Skip to content

Release

Release #234

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@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- 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 for npm
run: yarn build:npm
- 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: Rebase master to dev
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
git switch dev
git pull
git rebase master
git push
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
- 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