From 8406bc9a9165b43cb7ce076ec002ce3f3e1be58c Mon Sep 17 00:00:00 2001 From: Remisa Yousefvand Date: Sat, 30 Nov 2024 14:53:13 +0330 Subject: [PATCH] release #96 --- .github/workflows/cmake-multi-platform.yml | 69 +++++++++------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 86de4e9..8d86936 100755 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -7,7 +7,7 @@ on: branches: [main] jobs: - build-and-release: + build: runs-on: ${{ matrix.os }} strategy: @@ -27,7 +27,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Ubuntu build + # Step 2: Build and Package by OS + # Ubuntu - name: Install dependencies (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | @@ -48,20 +49,12 @@ jobs: - name: Package Notepad-- (Ubuntu) if: matrix.os == 'ubuntu-latest' run: | - BUILD_DIR="${{ github.workspace }}/build" - OUTPUT_DIR="${{ github.workspace }}/artifacts" - mkdir -p $OUTPUT_DIR - tar -czvf $OUTPUT_DIR/Notepad--_ubuntu.tar.gz -C $BUILD_DIR . - echo "Packaging completed. Listing artifacts directory:" - ls -al $OUTPUT_DIR - - name: Upload Ubuntu Artifact - if: matrix.os == 'ubuntu-latest' - uses: actions/upload-artifact@v3 - with: - name: Notepad--_ubuntu - path: "${{ github.workspace }}/artifacts/Notepad--_ubuntu.tar.gz" + mkdir -p artifacts + tar -czvf artifacts/Notepad--_ubuntu.tar.gz -C "${{ github.workspace }}/build" . + echo "Artifact packaged:" + ls -al artifacts/ - # macOS build + # macOS - name: Install dependencies (macOS) if: matrix.os == 'macos-latest' run: | @@ -79,20 +72,12 @@ jobs: - name: Package Notepad-- (macOS) if: matrix.os == 'macos-latest' run: | - BUILD_DIR="${{ github.workspace }}/build" - OUTPUT_DIR="${{ github.workspace }}/artifacts" - mkdir -p $OUTPUT_DIR - zip -r $OUTPUT_DIR/Notepad--_macos.zip $BUILD_DIR - echo "Packaging completed. Listing artifacts directory:" - ls -al $OUTPUT_DIR - - name: Upload macOS Artifact - if: matrix.os == 'macos-latest' - uses: actions/upload-artifact@v3 - with: - name: Notepad--_macos - path: "${{ github.workspace }}/artifacts/Notepad--_macos.zip" + mkdir -p artifacts + zip -r artifacts/Notepad--_macos.zip "${{ github.workspace }}/build" + echo "Artifact packaged:" + ls -al artifacts/ - # Windows build + # Windows - name: Install dependencies (Windows) if: matrix.os == 'windows-latest' run: | @@ -124,23 +109,22 @@ jobs: - name: Package Notepad-- (Windows) if: matrix.os == 'windows-latest' run: | - $BUILD_DIR="${{ github.workspace }}\\build" - $OUTPUT_DIR="${{ github.workspace }}\\artifacts" - mkdir $OUTPUT_DIR - Compress-Archive -Path "$BUILD_DIR\\*" -DestinationPath "$OUTPUT_DIR\\Notepad--_windows.zip" - echo "Packaging completed. Listing artifacts directory:" - Get-ChildItem -Path $OUTPUT_DIR + mkdir artifacts + Compress-Archive -Path "${{ github.workspace }}\\build\\*" -DestinationPath artifacts\\Notepad--_windows.zip + echo "Artifact packaged:" + Get-ChildItem artifacts shell: pwsh - - name: Upload Windows Artifact - if: matrix.os == 'windows-latest' + + # Upload artifacts for all OSes + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: - name: Notepad--_windows - path: "${{ github.workspace }}\\artifacts\\Notepad--_windows.zip" + name: Notepad--_artifacts_${{ matrix.os }} + path: artifacts/* release: runs-on: ubuntu-latest - needs: build-and-release + needs: build steps: - name: Checkout code uses: actions/checkout@v4 @@ -163,11 +147,12 @@ jobs: draft: false prerelease: false + # Upload artifacts to release - name: Upload Ubuntu Artifact uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: "${{ github.workspace }}/artifacts/Notepad--_ubuntu.tar.gz" + asset_path: artifacts/Notepad--_ubuntu.tar.gz asset_name: Notepad--_ubuntu.tar.gz asset_content_type: application/gzip @@ -175,7 +160,7 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: "${{ github.workspace }}/artifacts/Notepad--_macos.zip" + asset_path: artifacts/Notepad--_macos.zip asset_name: Notepad--_macos.zip asset_content_type: application/zip @@ -183,6 +168,6 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: "${{ github.workspace }}\\artifacts\\Notepad--_windows.zip" + asset_path: artifacts/Notepad--_windows.zip asset_name: Notepad--_windows.zip asset_content_type: application/zip