Skip to content

torinmb is deploying a new release 🚀 #3

torinmb is deploying a new release 🚀

torinmb is deploying a new release 🚀 #3

Workflow file for this run

name: Project Release
run-name: ${{ github.actor }} is deploying a new release 🚀
on:
push:
paths:
- 'package.json'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js with Yarn caching
uses: actions/setup-node@v3
with:
node-version: '16.13.x'
cache: 'yarn'
- name: Install Yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Create Zip of specified folders
run: |
zip -r release.zip "MediaPipe TouchDesigner.toe" "td_scripts" "toxes" "dist"
- name: Extract version and commit message
run: |
# Extract version from package.json
VERSION=$(jq -r .version package.json)
# Extract the latest commit message
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
- name: Create Release and Upload Asset
run: |
# Create Release
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --data '{
"tag_name": "v$PACKAGE_VERSION",
"name": "Release v$PACKAGE_VERSION",
"body": "$COMMIT_MESSAGE",
"draft": false,
"prerelease": true
}' "https://api.github.com/repos/$GITHUB_REPOSITORY/releases")
# Extract the upload_url value
UPLOAD_URL=$(echo "$RESPONSE" | jq -r .upload_url | sed -e "s/{?name,label}//")
# Upload Asset
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/zip" --data-binary @release.zip "$UPLOAD_URL?name=release.zip"