Skip to content

Commit

Permalink
release #12
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefvand committed Nov 28, 2024
1 parent beae469 commit 82768e1
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Ubuntu-specific steps
# Install dependencies
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y qt6-base-dev ninja-build cmake
# macOS-specific steps
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew install qt ninja cmake
# Windows-specific steps
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
Expand All @@ -50,30 +48,41 @@ jobs:
$env:CMAKE_PREFIX_PATH = "$QtPath\lib\cmake"
shell: pwsh

# Configure CMake
- name: Configure CMake
run: |
cmake -B "${{ github.workspace }}/build" \
-DCMAKE_BUILD_TYPE=Release \
-G "Ninja" \
-S "${{ github.workspace }}"
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}

# Build
- name: Build
run: |
cmake --build "${{ github.workspace }}/build" --parallel
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }}

- name: Package application
# Package the application
- name: Package application on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
tar -czf Notepad--.tar.gz -C "${{ github.workspace }}/build" .
shell: bash

- name: Package application on macOS
if: matrix.os == 'macos-latest'
run: |
if [[ "${{ matrix.os }}" == 'ubuntu-latest' ]]; then
tar -czf Notepad--.tar.gz -C "${{ github.workspace }}/build" .
elif [[ "${{ matrix.os }}" == 'macos-latest' ]]; then
hdiutil create -volname Notepad-- -srcfolder "${{ github.workspace }}/build" -ov -format UDZO Notepad--.dmg
else
Compress-Archive -Path "${{ github.workspace }}\build\*" -DestinationPath "Notepad--.zip"
fi
hdiutil create -volname Notepad-- -srcfolder "${{ github.workspace }}/build" -ov -format UDZO Notepad--.dmg
shell: bash

- name: Package application on Windows
if: matrix.os == 'windows-latest'
run: |
Compress-Archive -Path "${{ github.workspace }}\build\*" -DestinationPath "Notepad--.zip"
shell: pwsh

# Upload artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -108,8 +117,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/
asset_name: Notepad--${{ matrix.os }}.tar.gz
asset_name: Notepad--${{ matrix.os }}.dmg
asset_name: Notepad--${{ matrix.os }}.zip
asset_path: ./artifacts
asset_name: Notepad--_${{ matrix.os }}.tar.gz
asset_name: Notepad--_${{ matrix.os }}.dmg
asset_name: Notepad--_${{ matrix.os }}.zip
content_type: application/octet-stream

0 comments on commit 82768e1

Please sign in to comment.