Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

πŸ“ˆ perf: change distance setting #3

πŸ“ˆ perf: change distance setting

πŸ“ˆ perf: change distance setting #3

Workflow file for this run

name: PlatformIO CI/CD
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
discussions: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download website.h
run: |
OWNER="MakerbaseMoon"
REPO="3d_scanner_nextjs"
RELEASE_URL=$(curl -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/latest" | grep -o '"browser_download_url": "[^"]*website\.h"' | cut -d'"' -f4)
echo ${RELEASE_URL}
wget -P include/ ${RELEASE_URL}
echo "## 🌐 Next.JS Website" >> commit_msg.txt
TAG_VERSION=$(curl -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/latest" | grep -o '"tag_name": "[^"]*' | grep -o '[^"]*$')
echo "πŸ”–[Website Release](https://github.com/${OWNER}/${REPO}/releases/latest) 🏷️${TAG_VERSION}" >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
- name: Get commits between tags
run: |
TAG1=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1) | cut -d'-' -f1)
TAG2=$(git describe --tags)
COMMIT_RANGE="$TAG1..$TAG2"
echo "🏷️commit version: ${COMMIT_RANGE}"
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="feat:" --pretty=format:"%s" --date=short | grep -c "feat:") -gt 0 ]; then
echo "# ✨ Features" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="feat:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="fix:" --pretty=format:"%s" --date=short | grep -c "fix:") -gt 0 ]; then
echo "# πŸ› Bug Fixes" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="fix:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="docs:" --pretty=format:"%s" --date=short | grep -c "docs:") -gt 0 ]; then
echo "# πŸ“ Documentation" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="docs:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="style:" --pretty=format:"%s" --date=short | grep -c "style:") -gt 0 ]; then
echo "# 🎨 Style" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="style:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="refactor:" --pretty=format:"%s" --date=short | grep -c "refactor:") -gt 0 ]; then
echo "# ♻️ Refactoring" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="refactor:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="test:" --pretty=format:"%s" --date=short | grep -c "test:") -gt 0 ]; then
echo "# πŸ§ͺ Tests" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="test:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
if [ $(/usr/bin/git log ${COMMIT_RANGE} --grep="chore:" --pretty=format:"%s" --date=short | grep -c "chore:") -gt 0 ]; then
echo "# πŸš€ Chore" >> commit_msg.txt
/usr/bin/git log ${COMMIT_RANGE} --grep="chore:" --pretty=format:"- [%ad]%s ([%an](https://github.com/${{github.repository_owner}}/${{github.event.repository.name}}/commit/%h))" --date=short >> commit_msg.txt
echo -e "\n" >> commit_msg.txt
fi
- name: Change Version
run: |
sed -i "s/0\.0\.0/$(git describe --tags)/" ./include/version.h
- name: Install PlatformIO python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run -e OTA
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: commit_msg.txt
name: "ESP32 3D Scanner ${{ github.ref_name }}"
files: .pio/build/OTA/firmware.bin
token: ${{ secrets.GITHUB_TOKEN }}