Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Merge pull request #460 from gluestack/fix/links-1 #155

Merge pull request #460 from gluestack/fix/links-1

Merge pull request #460 from gluestack/fix/links-1 #155

Workflow file for this run

name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref || github.run_id }}
jobs:
release:
name: Publish version
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install Dependencies
run: |
yarn
yarn build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Get published package version
# id: version
# run: |
# for row in $(echo "${array}" | jq -r '.[] | @base64'); do
# _jq() {
# echo ${row} | base64 --decode | jq -r ${1}
# }
# PACKAGENAME=$(echo $(_jq '.name'))
# PACKAGEVERSION=$(echo $(_jq '.version'))
# if [ $PACKAGENAME = "@dank-style/storybook" ]
# then
# echo "::set-output name=version::$PACKAGEVERSION"
# echo "::set-output name=updateStorybook::1"
# fi
# done
# env:
# array: ${{ steps.changesets.outputs.publishedPackages }}
# - name: Emit repository_dispatch
# if: steps.version.outputs.updateStorybook == 1
# uses: mvasigh/dispatch-action@main
# with:
# # You should create a personal access token and store it in your repository
# token: ${{ secrets.MY_GITHUB_TOKEN }}
# repo: ui-storybook
# owner: gluestack
# event_type: dispatch_ui_storybook
# message: |
# {
# "version": "${{ steps.version.outputs.version }}"
# }
- name: Post to a Slack channel
id: slack
if: steps.changesets.outputs.published == 'true'
uses: slackapi/[email protected]
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
# You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs.
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
# For posting a simple plain text message
slack-message: "A new package was published in ${{ github.event.repository.name }}!\n${{ toJSON(steps.changesets.outputs.publishedPackages) }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}