Skip to content

🔢 Version 3.0.0 release candidate 1 #3

🔢 Version 3.0.0 release candidate 1

🔢 Version 3.0.0 release candidate 1 #3

Workflow file for this run

name: Development CI + CD
on:
push:
branches:
- development
jobs:
verify:
name: 🔎 Development verification
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4
- name: 🔃 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: 🔧 Install dependencies
run: npm install
- name: 🧐 Check code syntax
run: npm run lint
- name: 🏗️ Build library
run: npm run build
- name: 🚨 Test code functionality
run: npm test
build:
name: 🚀 Development build
runs-on: ubuntu-latest
needs: verify
steps:
- name: 🛎️ Checkout code
uses: actions/checkout@v4
- name: 🔃 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: 🔧 Install dependencies
run: npm install
- name: 🏗️ Build library
run: npm run build
- name: 🚀 Push new code
run: |
echo -e "\n# Initialize some useful variables"
REPO="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
BRANCH_OR_TAG=`awk -F/ '{print $2}' <<< $GITHUB_REF`
CURRENT_BRANCH=`awk -F/ '{print $NF}' <<< $GITHUB_REF`
if [ "$BRANCH_OR_TAG" == "heads" ]; then
SOURCE_TYPE="branch"
else
SOURCE_TYPE="tag"
fi
echo -e "\n# Checkout the repo in the target branch"
TARGET_BRANCH="build"
git clone $REPO out -b $TARGET_BRANCH
echo -e "\n# Remove any old files in the dist folder"
rm -rfv out/dist/*
echo -e "\n# Move the generated code to the newly-checked-out repo, to be committed and pushed"
rsync -vaI package.json out/
rsync -vaI package-lock.json out/
rsync -vaI README.md out/
rsync -vaI LICENSE out/
rsync -vaI dist/ out/dist
echo -e "\n# Commit and push"
cd out
git add --all .
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_EMAIL}"
git commit -m "build: tsc build for ${GITHUB_SHA}" || true
git push origin $TARGET_BRANCH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: karelkryda
GITHUB_EMAIL: ${{ secrets.EMAIL }}