chore(release): 2.42.1 #150
Workflow file for this run
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: Publish Octuple | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
NODE_VERSION: 16.14.2 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- run: yarn | |
- run: yarn test | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get version from tag | |
id: tag_name | |
run: | | |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} | |
shell: bash | |
- name: Prerelease check | |
id: prerelease_check | |
if: contains(steps.tag_name.outputs.current_version, '-') | |
run: | | |
echo ::set-output name=prerelease::true | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: https://registry.npmjs.org/ | |
- name: Run Yarn | |
run: yarn | |
- name: Publish release to npm | |
if: steps.prerelease_check.outputs.prerelease != 'true' | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
- name: Publish prerelease to npm | |
if: steps.prerelease_check.outputs.prerelease == 'true' | |
run: npm publish --tag prerelease | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: artlaman/[email protected] | |
with: | |
version: ${{ steps.tag_name.outputs.current_version }} | |
path: ./CHANGELOG.md | |
- name: Create/update release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: Release ${{ steps.changelog_reader.outputs.version }} | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
prerelease: ${{ steps.prerelease_check.outputs.prerelease == 'true' }} | |
allowUpdates: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- run: yarn build-storybook | |
if: steps.prerelease_check.outputs.prerelease != 'true' | |
- name: Pushes to another repository | |
if: steps.prerelease_check.outputs.prerelease != 'true' | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'storybook-static' | |
destination-github-username: 'EightfoldAI' | |
destination-repository-name: 'octuple.github.io' | |
user-email: [email protected] | |
target-branch: main | |