Skip to content

Mock #9

Mock #9 #11

Workflow file for this run

name: Create Release
on:
pull_request:
branches:
- main
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get Pull Request Body
id: pr_body
run: |
BODY=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
${{ github.api_url }}/repos/${{ github.repository }}/pulls/${{ github.event.number }} \
| jq -r '.body')
echo "Pull Request Body: $BODY" # Debug
echo "BODY=$BODY" >> $GITHUB_ENV
- name: Extract Version and Changes
id: extract_version_and_changes
run: |
VERSION_CHANGES=$(bash ./scripts/extract_version_and_changes.sh "${{ steps.pr_body.outputs.body }}")
echo "Extracted Version and Changes: $VERSION_CHANGES" # Debug message
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install Bun dependencies
run: bun install
- name: Export project using Bun
run: bun export
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.number }}-${{ steps.extract_version_and_changes.outputs.version }}
release_name: Release ${{ steps.extract_version_and_changes.outputs.version }}
body: |
Changes in this Release:
${{ steps.extract_version_and_changes.outputs.changes }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: cesium.zip
asset_content_type: application/zip