Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Jan 16, 2025
2 parents 7a1f9a9 + 4f488bd commit 30ec5e3
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,26 @@ jobs:
shell: cmd
run: '"%msbuild_path%\MSBuild.exe" /p:Platform=Windows /p:Configuration=${{ matrix.configuration }} /m spartan.sln'

- name: Generate version
id: version
run: |
echo "version=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
echo "Generated version: ${{ env.version }}"
- name: Create artifacts
if: github.event_name != 'pull_request' && matrix.api == 'vulkan'
shell: cmd
run: |
echo "Creating artifacts for ${{ matrix.api }} - ${{ matrix.configuration }}"
SET BUILD_NAME=spartan_${{ matrix.api }}_${{ matrix.configuration }}_${{ env.version }}
echo "Build name: %BUILD_NAME%"
build_scripts\7z.exe a -bb1 %BUILD_NAME%.7z .\binaries\7z.exe .\binaries\dxcompiler.dll .\binaries\download_assets.py .\binaries\file_utilities.py .\binaries\fmod.dll .\binaries\data .\binaries\spartan_${{ matrix.api }}.exe
echo "::set-output name=artifact_name::%BUILD_NAME%.7z"
IF "${{ matrix.configuration }}" == "Release" (
echo "Creating binaries-only archive for Release..."
build_scripts\7z.exe a -bb1 spartan_vulkan_release.7z .\binaries\7z.exe .\binaries\dxcompiler.dll .\binaries\download_assets.py .\binaries\file_utilities.py .\binaries\fmod.dll .\binaries\data .\binaries\spartan_${{ matrix.api }}.exe
) ELSE (
echo "Creating binaries-only archive for Debug..."
build_scripts\7z.exe a -bb1 spartan_vulkan_debug.7z .\binaries\7z.exe .\binaries\dxcompiler.dll .\binaries\download_assets.py .\binaries\file_utilities.py .\binaries\fmodL.dll .\binaries\data .\binaries\spartan_${{ matrix.api }}_debug.exe
)
echo "Artifact creation completed for ${{ matrix.api }} - ${{ matrix.configuration }}"
- name: Upload artifact
if: github.event_name != 'pull_request' && matrix.api == 'vulkan'
uses: actions/upload-artifact@v4
with:
name: ${{ env.version }}
path: ${{ steps.create-artifacts.outputs.artifact_name }}
name: spartan_vulkan_${{ matrix.configuration == 'Release' && 'release' || 'debug' }}
path: spartan_vulkan_${{ matrix.configuration == 'Release' && 'release' || 'debug' }}.7z

release:
if: github.event_name != 'pull_request'
Expand All @@ -96,22 +94,29 @@ jobs:
- name: Download vulkan release build
uses: actions/download-artifact@v4
with:
name: ${{ env.version }}
name: spartan_vulkan_release
path: spartan_vulkan_release.7z

- name: Download vulkan debug build
uses: actions/download-artifact@v4
with:
name: ${{ env.version }}
name: spartan_vulkan_debug
path: spartan_vulkan_debug.7z

- name: Get date and time for versioning
id: get_datetime
run: echo "version=$(date +'%Y.%m.%d-%H.%M')" >> $GITHUB_OUTPUT

- name: Publish release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.version }}"
automatic_release_tag: "v${{ steps.get_datetime.outputs.version }}"
prerelease: true
title: "Development Build v${{ env.version }}"
title: "Version ${{ steps.get_datetime.outputs.version }}"
files: |
spartan_vulkan_release.7z
spartan_vulkan_debug.7z
spartan_vulkan_debug.7z
- name: Set environment file for release
run: echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV

0 comments on commit 30ec5e3

Please sign in to comment.