Update main.yml #5
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 "::set-output name=body::$BODY" | |
- name: Add Version and Get Changes | |
id: increment_version | |
run: | | |
./scripts/increment_version.sh "${{ steps.pr_body.outputs.body }}" | |
env: | |
VERSION_CHANGES: ${{ steps.increment_version.outputs.stdout }} | |
- 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: ${{ steps.increment_version.outputs.version }} | |
release_name: Release ${{ steps.increment_version.outputs.version }} | |
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 |