Skip to content

Update main.yml

Update main.yml #16

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
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: GET /repos/:owner/:repo/pulls/:pull_number
owner: ${{ github.repository_owner }}
repo: ${{ github.repository }}
pull_number: ${{ github.event.number }}
- name: Save Pull Request Body
run: echo "${{ steps.pr_body.outputs.data.body }}" > pr_body.txt
- name: Extract Version and Changes
id: extract_version_and_changes
run: |
VERSION_CHANGES=$(bash ./scripts/version.sh "$(cat pr_body.txt)")
echo "Extracted Version and Changes: $VERSION_CHANGES" # Debug
echo "VERSION_CHANGES=$VERSION_CHANGES" >> $GITHUB_ENV
- name: Setup Cesium
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 }}
VERSION_NUMBER: ${{ steps.extract_version_and_changes.outputs.stdout }}
VERSION_CHANGES: ${{ steps.extract_version_and_changes.outputs.stdout }}
with:
tag_name: ${{ github.event.number }}-${{ env.VERSION_NUMBER }}
release_name: Release ${{ env.VERSION_NUMBER }}
body: |
Changes in this Release:
${{ env.VERSION_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