mock #12
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: 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/version.sh "${{ steps.pr_body.outputs.BODY }}") | |
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 |