Skip to content

Release/v4.15.0 beta.3 #197

Release/v4.15.0 beta.3

Release/v4.15.0 beta.3 #197

Workflow file for this run

name: Dev release pipeline
on:
pull_request:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
sync_dev:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
environment:
name: dev
url: https://uikit.dev.amity.co/${{ github.event.pull_request.number }}
env:
NPM_FONT_AWESOME_TOKEN: ${{ secrets.NPM_FONT_AWESOME_TOKEN }}
STORYBOOK_API_REGION: ${{ secrets.STORYBOOK_API_REGION }}
STORYBOOK_API_KEY: ${{ secrets.STORYBOOK_API_KEY }}
STORYBOOK_USERS: ${{ secrets.STORYBOOK_USERS }}
STORYBOOK_VISITOR_AUTH_SIGNATURE_URL: ${{ secrets.STORYBOOK_VISITOR_AUTH_SIGNATURE_URL }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: install node
uses: actions/setup-node@v4
with:
node-version-file: .tool-versions
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path | tr -d '\n')" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: build storybook
run: pnpm run storybook:build
- name: get version
id: version
run: echo "current_version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: increase version (pre-release)
run: pnpm standard-version --release-as ${{ steps.version.outputs.current_version }} --prerelease alpha.$(git rev-parse --short HEAD) --skip.changelog --skip.commit --skip.tag
- name: unpublish old version
if: "contains(github.event.pull_request.title, '(sdk):')"
continue-on-error: true
run: |
prev=$(npm view @amityco/ui-kit dist-tags.dev/${{ github.event.pull_request.number }})
[[ ! -z $prev ]] && npm unpublish @amityco/ui-kit@$prev
- name: build
run: pnpm run build
- name: publish on npm with dev dist-tag
if: "contains(github.event.pull_request.title, '(sdk):')"
continue-on-error: true
run: npm publish --tag dev/${{ github.event.pull_request.number }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_OIDC_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Sync to S3
env:
AWS_S3_BUCKET: uikit.dev.amity.co
SOURCE_DIR: storybook-build
run: |
aws s3 sync ./$SOURCE_DIR s3://$AWS_S3_BUCKET/${{ github.event.pull_request.number }} --acl public-read --follow-symlinks --delete