Skip to content

Merge pull request #308 from rohit-gohri/changeset-release/main #156

Merge pull request #308 from rohit-gohri/changeset-release/main

Merge pull request #308 from rohit-gohri/changeset-release/main #156

Workflow file for this run

name: Version
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
YARN_COMPRESSION_LEVEL: 0
YARN_ENABLE_GLOBAL_CACHE: true
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn install --immutable
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
version: yarn run version
publish: yarn run release
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
version:
name: Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn install --immutable
- name: New redocusaurus release
run: |
yarn workspace redocusaurus exec "sh $PWD/scripts/release.sh" >> $GITHUB_ENV
- name: Create Github Release
if: |
env.github_release == 'yes'
uses: softprops/action-gh-release@master
with:
body_path: latest-CHANGELOG.md
tag_name: v${{ env.package_version }}
target_commitish: ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}