adding more stuff for auto building releases
mobile coding is hell its the only thing i can use though while being on vacation sob i dont wanna stay for too long without doing shits
This commit is contained in:
@@ -10,6 +10,9 @@ on:
|
|||||||
description: "Is this a prerelease?"
|
description: "Is this a prerelease?"
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
|
custom_message:
|
||||||
|
description: "Optional pre-changelog message"
|
||||||
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
collect-release:
|
collect-release:
|
||||||
@@ -36,7 +39,7 @@ jobs:
|
|||||||
path: artifacts/windows/executable
|
path: artifacts/windows/executable
|
||||||
allow_forks: false
|
allow_forks: false
|
||||||
|
|
||||||
- name: Download macOS Full Build
|
- name: Download Mac OS Full Build
|
||||||
uses: dawidd6/action-download-artifact@v6
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
with:
|
||||||
workflow: macos.yml
|
workflow: macos.yml
|
||||||
@@ -44,7 +47,7 @@ jobs:
|
|||||||
path: artifacts/macos/full_build
|
path: artifacts/macos/full_build
|
||||||
allow_forks: false
|
allow_forks: false
|
||||||
|
|
||||||
- name: Download macOS Executable
|
- name: Download Mac OS Executable
|
||||||
uses: dawidd6/action-download-artifact@v6
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
with:
|
||||||
workflow: macos.yml
|
workflow: macos.yml
|
||||||
@@ -78,7 +81,7 @@ jobs:
|
|||||||
zip -r ../../../renamed/"Codename Engine-Windows.zip" *
|
zip -r ../../../renamed/"Codename Engine-Windows.zip" *
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# macOS
|
# Mac OS
|
||||||
mv artifacts/macos/executable/CodenameEngine renamed/update-mac
|
mv artifacts/macos/executable/CodenameEngine renamed/update-mac
|
||||||
cd artifacts/macos/full_build
|
cd artifacts/macos/full_build
|
||||||
if [ -f CodenameEngine.tar.gz ]; then
|
if [ -f CodenameEngine.tar.gz ]; then
|
||||||
@@ -109,7 +112,7 @@ jobs:
|
|||||||
-L 50 -q '.[] | select(.isPrerelease==false and .isDraft==false) | .tagName' | head -n 1)
|
-L 50 -q '.[] | select(.isPrerelease==false and .isDraft==false) | .tagName' | head -n 1)
|
||||||
|
|
||||||
if [ -z "$BASE" ]; then
|
if [ -z "$BASE" ]; then
|
||||||
echo "No stable release found, resorting to prereleases"
|
echo "No stable release found, resorting to prereleases."
|
||||||
BASE=$(gh release list --repo ${{ github.repository }} --json tagName,isDraft \
|
BASE=$(gh release list --repo ${{ github.repository }} --json tagName,isDraft \
|
||||||
-L 1 -q '.[] | select(.isDraft==false) | .tagName')
|
-L 1 -q '.[] | select(.isDraft==false) | .tagName')
|
||||||
fi
|
fi
|
||||||
@@ -118,24 +121,59 @@ jobs:
|
|||||||
-L 50 -q '.[] | select(.isPrerelease==false and .isDraft==false) | .tagName' | head -n 1)
|
-L 50 -q '.[] | select(.isPrerelease==false and .isDraft==false) | .tagName' | head -n 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Base release: $BASE"
|
if [ -z "$BASE" ]; then
|
||||||
echo "base_release=$BASE" >> $GITHUB_OUTPUT
|
echo "No older release found; please make sure to have at least one older release containing the 'update-assets.zip' file in order to generate the differences."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Base release: $BASE"
|
||||||
|
echo "base_release=$BASE" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Prepare update-assets.zip
|
- name: Prepare update-assets.zip
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p update_assets_temp renamed
|
echo "Looking for 'update-assets.zip' from release '${{ steps.get_base_release.outputs.base_release }}'"
|
||||||
echo "Downloading assets from release ${{ steps.get_base_release.outputs.base_release }}"
|
ASSETS=$(gh release view "${{ steps.get_base_release.outputs.base_release }}" \
|
||||||
gh release download "${{ steps.get_base_release.outputs.base_release }}" \
|
--repo "${{ github.repository }}" \
|
||||||
--repo ${{ github.repository }} \
|
--json assets \
|
||||||
--pattern "update-assets.zip" \
|
| jq -r '.assets[].name')
|
||||||
-D update_assets_temp
|
|
||||||
|
|
||||||
unzip -q update_assets_temp/update-assets.zip -d update_assets_temp
|
if echo "$ASSETS" | grep -xq "update-assets.zip"; then
|
||||||
cd update_assets_temp
|
mkdir -p update_assets_temp renamed
|
||||||
zip -r ../renamed/update-assets.zip assets
|
echo "Downloading assets from release '${{ steps.get_base_release.outputs.base_release }}'"
|
||||||
cd ..
|
gh release download "${{ steps.get_base_release.outputs.base_release }}" \
|
||||||
|
--repo ${{ github.repository }} \
|
||||||
|
--pattern "update-assets.zip" \
|
||||||
|
-D update_assets_temp
|
||||||
|
|
||||||
|
unzip -q update_assets_temp/update-assets.zip -d update_assets_temp
|
||||||
|
cd update_assets_temp
|
||||||
|
zip -r ../renamed/update-assets.zip . -i assets
|
||||||
|
else
|
||||||
|
echo "No 'update-assets.zip' file found in release '${{ steps.get_base_release.outputs.base_release }}'; please make sure to have this file in that older release in order to generate the differences."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Prepare pre-changelog message
|
||||||
|
id: pre_changelog_message
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
echo "Preparing a pre-changelog message..."
|
||||||
|
|
||||||
|
BODY="If you would like to download the full builds of the engine from this release, please ignore the files starting with 'update-' as they're needed for the engine's internal autoupdater.\n\n"
|
||||||
|
|
||||||
|
if [ -n "${{ github.event.inputs.custom_message }}" ]; then
|
||||||
|
BODY="${{ github.event.inputs.custom_message }}\n${BODY}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "body<<EOF"
|
||||||
|
echo -e "$BODY"
|
||||||
|
echo "EOF"
|
||||||
|
} >> $GITHUB_OUTPUT
|
||||||
|
echo -e "Final pre-changelog message:\n\n$BODY"
|
||||||
|
|
||||||
- name: Create GitHub Release with Assets
|
- name: Create GitHub Release with Assets
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
@@ -146,13 +184,14 @@ jobs:
|
|||||||
name: Release ${{ github.event.inputs.tag_name }}
|
name: Release ${{ github.event.inputs.tag_name }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: ${{ github.event.inputs.prerelease }}
|
prerelease: ${{ github.event.inputs.prerelease }}
|
||||||
|
body: ${{ steps.build_body.outputs.body }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |
|
files: |
|
||||||
renamed/Codename Engine-Windows.zip
|
renamed/Codename Engine-Windows.zip
|
||||||
renamed/update-windows.exe
|
|
||||||
renamed/Codename Engine-Mac.zip
|
renamed/Codename Engine-Mac.zip
|
||||||
renamed/Codename Engine-Mac.tar.gz
|
renamed/Codename Engine-Mac.tar.gz
|
||||||
renamed/update-mac
|
|
||||||
renamed/Codename Engine-Linux.zip
|
renamed/Codename Engine-Linux.zip
|
||||||
renamed/update-linux
|
|
||||||
renamed/update-assets.zip
|
renamed/update-assets.zip
|
||||||
|
renamed/update-windows.exe
|
||||||
|
renamed/update-mac
|
||||||
|
renamed/update-linux
|
||||||
Reference in New Issue
Block a user