Skip to content

Commit

Permalink
Added changelog deployment, and version deployment to the core system.
Browse files Browse the repository at this point in the history
If this works, then we should beable to present builds on the website <3
  • Loading branch information
Bioblaze committed Jan 10, 2025
1 parent 342e59b commit 03eb3de
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/actions/cerebro-update-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Blazium Cerebro Update Version

description: Update Version Information

inputs:
version:
description: The version number.
required: true
changelog_url:
description: URL to the changelog.
required: true
deploy_type:
description: Type of deployment (e.g., nightly, stable).
required: true
templates_url:
description: URL to the templates.
required: true
version_url:
description: URL of the version.
required: true
cerebro_url:
description: The full URL to send the update.
required: true
cerebro_auth:
description: Auth Key to Cerebro for Blazium.
required: true

runs:
using: "composite"
steps:
- name: Send Cerebro Update Version Command
shell: bash
run: |
RESPONSE=$(curl -X POST "${{ inputs.cerebro_url }}/api/v1/versions" \
-H "Content-Type: application/json" \
-H "BLAZIUM_AUTH: ${{ inputs.cerebro_auth }}" \
-d '{
"version": "${{ inputs.version }}",
"changelog_url": "${{ inputs.changelog_url }}",
"deploy_type": "${{ inputs.deploy_type }}",
"templates_url": "${{ inputs.templates_url }}",
"version_url": "${{ inputs.version_url }}"
}')
echo "## Update Version Information (Triggered)" >> $GITHUB_STEP_SUMMARY
# Parse the response and check for success: true
if [[ $(echo "$RESPONSE" | jq -r '.success') != "true" ]]; then
echo "Error: Update failed, 'success' is not true in the response." >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "Update succeeded." >> $GITHUB_STEP_SUMMARY
fi
84 changes: 83 additions & 1 deletion .github/workflows/deploy_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,70 @@ concurrency:

jobs:

changelog-deploy:
name: Changelog Generation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: blazium-engine/blazium
ref: ${{ github.event.client_payload.branch || env.GODOT_BASE_BRANCH }}
fetch-depth: 2

- name: Pull .github folder from ci_cd repository
run: |
git clone --depth=1 https://github.com/blazium-engine/ci_cd.git ci_cd_repo
cp -r ci_cd_repo/.github/* .github/
mv ci_cd_repo/cicd ./
rm -rf ci_cd_repo
- name: Get Latest Commit SHA
id: get_sha
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Parse version.py
id: version
uses: ./.github/actions/get-repos-version
with:
file_path: version.py

- name: Generate Changelog.json
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_OWNER: blazium-engine
GITHUB_REPO: blazium
BASE_BRANCH: ${{ steps.version.outputs.external_sha }}
CURRENT_BRANCH: ${{ steps.get_sha.outputs.sha }}
MAJOR_VERSION: ${{ steps.version.outputs.external_major }}
MINOR_VERSION: ${{ steps.version.outputs.external_minor }}
PATCH_VERSION: ${{ steps.version.outputs.external_patch }}
run: |
node ./cicd/scripts/changelog.js $(pwd)
- name: Generate changelog.txt
id: changelog
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_OWNER: blazium-engine
GITHUB_REPO: blazium
BASE_BRANCH: ${{ steps.version.outputs.external_sha }}
CURRENT_BRANCH: ${{ steps.get_sha.outputs.sha }}
MAJOR_VERSION: ${{ steps.version.outputs.external_major }}
MINOR_VERSION: ${{ steps.version.outputs.external_minor }}
PATCH_VERSION: ${{ steps.version.outputs.external_patch }}
run: |
node ./cicd/scripts/changelog2txt.js ${{ github.workspace }}/changelog.json
- uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.DO_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SECRET_KEY }}
space_name: ${{ secrets.DO_SPACE_NAME }}
space_region: ${{ secrets.DO_SPACE_REGION }}
source: changelog.txt
out_dir: ${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }}

template-deploy:
name: 📊 Template Deploy
if: contains(github.event.client_payload.deploy, 'templates')
Expand Down Expand Up @@ -91,4 +155,22 @@ jobs:
windows-build: ${{ inputs.windows-build }}
macos-build: ${{ inputs.macos-build }}
linux-build: ${{ inputs.linux-build }}
android-build: ${{ inputs.android-build }}
android-build: ${{ inputs.android-build }}

update-version:
name: Update Version Publically
needs: [editor-deploy, template-deploy, changelog-deploy]
runs-on: ubuntu-latest
steps:

- name: Update Cerebro of new Version
id: new_version
uses: ./.github/actions/cerebro-update-version
with:
version: ${{ inputs.new_version }}
changelog_url: ${{ secrets.CDN_URL }}/${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }}/changelog.txt
deploy_type: ${{ github.event.client_payload.type || 'nightly' }}
templates_url: ${{ secrets.CDN_URL }}/${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }}/details.json
version_url: ${{ secrets.CDN_URL }}/${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }}/editors.json
cerebro_url: ${{ secrets.CEREBRO_URL }}
cerebro_auth: ${{ secrets.BLAZIUM_AUTH }}

0 comments on commit 03eb3de

Please sign in to comment.