torinmb is deploying a new release 🚀 #10
Workflow file for this run
This file contains 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
name: Project Release | |
run-name: ${{ github.actor }} is deploying a new release 🚀 | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
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: 'npm' | |
- 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: Get tag details | |
id: tag-details | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
TAG_MESSAGE=$(git tag -l --format='%(contents)' $TAG_NAME) | |
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_OUTPUT" | |
echo "TAG_MESSAGE=$TAG_MESSAGE" >> "$GITHUB_OUTPUT" | |
- name: Display Tag Details | |
run: | | |
echo "Tag Name: ${{ steps.tag-details.outputs.TAG_NAME }}" | |
echo "Tag Message: ${{ steps.tag-details.outputs.TAG_MESSAGE }}" | |
- name: Create Release and Upload Asset | |
run: | | |
# Create Release | |
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" --data '{ | |
"tag_name": "v${{ steps.tag-details.outputs.TAG_NAME }}", | |
"name": "Release v${{ steps.tag-details.outputs.TAG_NAME }}", | |
"body": "${{ steps.tag-details.outputs.TAG_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" |