Skip to content

Release

Release #4

Workflow file for this run

name: Release
on: workflow_dispatch
jobs:
release-tags:
name: Generate Release Tags
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Get the latest version
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
body: |
Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy to AWS S3
runs-on: ubuntu-latest
env:
AWS_S3_BUCKET: tarka-public-libraries
AWS_REGION: ap-south-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Get the latest version
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: yarn
- name: Generate builds
run: yarn build
- name: Rename build files
run: |
current_version=$(echo "${{ steps.get_version.outputs.version }}")
mv dist/tarka-chat.es.js "dist/tarka-chat-${current_version}.es.js"
mv dist/tarka-chat.umd.js "dist/tarka-chat-${current_version}.umd.js"
- name: Push the files to S3 bucket
uses: jakejarvis/s3-sync-action@master
env:
SOURCE_DIR: "dist"
AWS_S3_BUCKET: ${{ env.AWS_S3_BUCKET }}
AWS_REGION: ${{ env.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}