Skip to content

Commit

Permalink
Update cmake-multi-platform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ld3 authored Sep 28, 2024
1 parent f8a5412 commit da118b5
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
with:
fetch-depth: 0 # complete history
fetch-tags: true

- name: Get Git Tag
id: tags
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Install Qt6 dependencies for Windows
if: runner.os == 'Windows'
Expand Down Expand Up @@ -99,29 +103,22 @@ jobs:
- name: Install Build Output
run: cmake --install ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --strip

- name: Get Tag Name
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV # Set TAG_NAME in GITHUB_ENV
shell: bash

- name: Compress Build Output
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
if [ "${{ runner.os }}" == "Linux" ]; then
cd ${{ steps.strings.outputs.build-output-dir }}/install && tar -cvzf ../../dartomato-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ TAG_NAME }}.tar.gz *
cd ${{ steps.strings.outputs.build-output-dir }}/install && tar -cvzf ../../dartomato-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ steps.tags.outputs.tag }}.tar.gz *
else
pwsh -Command "Compress-Archive -Path '${{ steps.strings.outputs.build-output-dir }}/bin/*' -DestinationPath 'dartomato-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ TAG_NAME }}.zip'"
pwsh -Command "Compress-Archive -Path '${{ steps.strings.outputs.build-output-dir }}/bin/*' -DestinationPath 'dartomato-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ steps.tags.outputs.tag }}.zip'"
fi
shell: bash

- name: Upload Artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: dartomat-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ TAG_NAME }}
path: dartomat-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ TAG_NAME }}.${{ runner.os == 'Linux' && 'tar.gz' || 'zip' }}
name: dartomat-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ steps.tags.outputs.tag }}
path: dartomat-build-${{ matrix.os }}-${{ matrix.build_type }}-${{ steps.tags.outputs.tag }}.${{ runner.os == 'Linux' && 'tar.gz' || 'zip' }}

deploy:
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -136,22 +133,20 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Get Tag Name
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV # Set TAG_NAME in GITHUB_ENV
shell: bash
- name: Get Git Tag
id: tags
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: dartomato-build-ubuntu-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}
name: dartomato-build-ubuntu-latest-Release-${{ steps.tags.outputs.tag }}
path: ./linux/

- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: dartomato-build-windows-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}
name: dartomato-build-windows-latest-Release-${{ steps.tags.outputs.tag }}
path: ./windows/

- name: Create Release
Expand All @@ -171,8 +166,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/dartomato-build-ubuntu-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}.tar.gz
asset_name: dartomato-build-ubuntu-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}.tar.gz
asset_path: ./linux/dartomato-build-ubuntu-latest-Release-${{ steps.tags.outputs.tag }}.tar.gz
asset_name: dartomato-build-ubuntu-latest-Release-${{ steps.tags.outputs.tag }}.tar.gz
asset_content_type: application/gzip

- name: Upload Windows Release Asset
Expand All @@ -181,7 +176,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows/dartomato-build-windows-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}.zip
asset_name: dartomato-build-windows-latest-Release-${{ steps.get_tag.outputs.TAG_NAME }}.zip
asset_path: ./windows/dartomato-build-windows-latest-Release-${{ steps.tags.outputs.tag }}.zip
asset_name: dartomato-build-windows-latest-Release-${{ steps.tags.outputs.tag }}.zip
asset_content_type: application/zip

0 comments on commit da118b5

Please sign in to comment.