Manual workflow - Release version - 0.3.13 #104
This file contains hidden or 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
# This is a basic workflow that is manually triggered | |
run-name: Manual workflow - Release version - ${{ github.event.inputs.version }} | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
version: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: "Release version" | |
# Input has to be provided for the workflow to run | |
required: true | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
release-library: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Version number | |
run: echo "Release version -> ${{ github.event.inputs.version }}" | |
- name: Checkout Repo | |
uses: actions/checkout@v4.1.6 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: 20.9.0 | |
- name: Install Dependencies | |
env: | |
CYPRESS_INSTALL_BINARY: 0 # Skip install of Cypress (handled in its own job) | |
HUSKY_SKIP_INSTALL: 1 # Skip install of Husky | |
run: | | |
npm ci | |
- name: Build the package | |
run: | | |
export PATH="$PATH:$(npm bin)" | |
npm run build-babel | |
- name: Create release directory | |
run: | | |
mkdir release | |
echo "`jq '.version="${{ github.event.inputs.version }}"' package.json`" > ./release/package.json | |
cp -r dist ./release/dist/ | |
find src -name "*.d.ts" -exec cp --parents {} release \; | |
cp release-readme.md ./release/README.md | |
cp index.d.ts ./release/index.d.ts | |
- name: create release repo | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: v${{ github.event.inputs.version }} | |
FOLDER: ./release | |
GITHUB_TOKEN: ${{ github.token }} |