Skip to content

Build and Release

Build and Release #1

Workflow file for this run

name: Build and Release
on:
workflow_dispatch: # Allows manual triggering from the GitHub UI
push:
tags:
- "v*" # Triggers on tag push matching v1.0, v1.1, etc.
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
cache: "yarn"
- name: Install Yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Build
run: yarn bundle
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Production Bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./packages/core/umd/production/index.min.js
asset_name: core.min.js
asset_content_type: application/javascript
- name: Upload Development Bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./packages/core/umd/development/index.js
asset_name: core.js
asset_content_type: application/javascript
- name: Upload Development Source Map
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./packages/core/umd/development/index.js.map
asset_name: core.js.map
asset_content_type: application/json