Merge pull request #721 from MihailRis/new-pipeline

new automatic release pipeline
This commit is contained in:
MihailRis 2025-12-04 08:57:33 +03:00 • committed by GitHub
commit dc1afa9a28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 38 deletions

View file

@ -5,6 +5,7 @@ on:
branches: [ "main", "release-**"]
pull_request:
branches: [ "main", "dev" ]
workflow_call:
jobs:
build-appimage:

View file

@ -5,6 +5,7 @@ on:
branches: [ "main", "release-**"]
pull_request:
branches: [ "main", "dev" ]
workflow_call:
jobs:
build-dmg:

View file

@ -1,43 +1,63 @@
# adopted from https://github.com/PrismLauncher/PrismLauncher
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: 'Engine release version'
required: true
default: "0.0.0"
branch:
description: 'Release branch name'
required: true
default: "release-0.0"
env:
RELEASE_VERSION: ${{ github.event.inputs.version || 'testrelease' }}
BRANCH_NAME: ${{ github.event.inputs.branch || 'main' }}
jobs:
build_release:
name: Build Release
uses: ./.github/workflows/cmake.yml
with:
build_type: Release
upload_artifacts: true
create_release:
needs: build_release
build_linux:
uses: ./.github/workflows/appimage.yml
build_macos:
uses: ./.github/workflows/macos.yml
build_windows:
uses: ./.github/workflows/windows-clang.yml
publish_release:
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: VoxelEngine
- name: Pack artifacts
run: |
chmod +x VoxelEngine
zip -r VoxelEngine.zip res VoxelEngine
- name: Grab and store version
run: |
tag_name=$(echo ${{ github.ref }} | grep -oE "v[^/]+$")
echo "VERSION=$tag_name" >> $GITHUB_ENV
- name: Checkout Release Branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Show Artifacts
run: |
mkdir release
mv ./artifacts/AppImage/VoxelCore-latest-x86_64.AppImage \
./release/voxelcore-${RELEASE_VERSION}_x86-64.AppImage
mv ./artifacts/VoxelEngineMacOs/VoxelEngineMacApp.dmg \
./release/voxelcore-${RELEASE_VERSION}_macos.dmg
(cd ./artifacts/Windows-Build && zip -r ../../release/voxelcore-${RELEASE_VERSION}_win64.zip .)
ls -la ./release
tree ./release
- name: Create Tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
TAG_NAME="v${RELEASE_VERSION}"
git tag -a "${TAG_NAME}" -m "Automated release tag ${TAG_NAME}"
git push origin "${TAG_NAME}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.RELEASE_VERSION }}
draft: true
files: |
./release/*
generate_release_notes: true
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }}
name: VoxelEngine ${{ env.VERSION }}
draft: true
prerelease: false
files: |
VoxelEngine.zip

View file

@ -4,7 +4,8 @@ on:
push:
branches: [ "main", "release-**"]
pull_request:
branches: [ "main", "dev" ]
branches: [ "main", "dev" ]
workflow_call:
jobs:
build-windows: