diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 121c5a603..9fd508b99 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -5,6 +5,7 @@ on: branches: [ "main", "release-**"] pull_request: branches: [ "main", "dev" ] + workflow_call: jobs: build-appimage: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bb40a7ad2..75622c426 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,6 +5,7 @@ on: branches: [ "main", "release-**"] pull_request: branches: [ "main", "dev" ] + workflow_call: jobs: build-dmg: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1186ce30..36fd0e789 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/windows-clang.yml b/.github/workflows/windows-clang.yml index cb4864096..40ebca9dc 100644 --- a/.github/workflows/windows-clang.yml +++ b/.github/workflows/windows-clang.yml @@ -4,7 +4,8 @@ on: push: branches: [ "main", "release-**"] pull_request: - branches: [ "main", "dev" ] + branches: [ "main", "dev" ] + workflow_call: jobs: build-windows: