|
| 1 | +name: Build All-in-one |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["main"] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build_windows_x64: |
| 10 | + name: Build for Windows (x64) |
| 11 | + runs-on: windows-2022 |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Build |
| 17 | + run: ./Update-Win64.ps1 |
| 18 | + shell: pwsh |
| 19 | + working-directory: ./scripts |
| 20 | + |
| 21 | + - name: Upload Artifact |
| 22 | + uses: actions/upload-artifact@v4 |
| 23 | + with: |
| 24 | + name: build-windows-x64 |
| 25 | + path: output/CefViewCore/ |
| 26 | + |
| 27 | + build_macos_universal: |
| 28 | + name: Build for macOS (x64 & ARM64) |
| 29 | + runs-on: macos-14 |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Select specific Xcode version |
| 36 | + uses: maxim-lobanov/setup-xcode@v1 |
| 37 | + with: |
| 38 | + xcode-version: "15.4" |
| 39 | + - name: Verify Xcode version |
| 40 | + run: xcodebuild -version |
| 41 | + |
| 42 | + - name: Build |
| 43 | + run: | |
| 44 | + chmod +x Update-Mac.sh |
| 45 | + ./Update-Mac.sh |
| 46 | + shell: bash |
| 47 | + working-directory: ./scripts |
| 48 | + |
| 49 | + - name: Upload Artifact |
| 50 | + uses: actions/upload-artifact@v4 |
| 51 | + with: |
| 52 | + name: build-macos-universal |
| 53 | + path: output/CefViewCore/ |
| 54 | + |
| 55 | + build_linux_x64: |
| 56 | + name: Build for Linux (x64) |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - name: Install Dependencies |
| 63 | + run: | |
| 64 | + sudo apt-get update |
| 65 | + sudo apt-get install -y build-essential clang cmake git libc++-dev libc++abi-dev libx11-dev |
| 66 | +
|
| 67 | + - name: Build |
| 68 | + run: | |
| 69 | + chmod +x Update-Linux.sh |
| 70 | + ./Update-Linux.sh |
| 71 | + shell: bash |
| 72 | + working-directory: ./scripts |
| 73 | + |
| 74 | + - name: Upload Artifact |
| 75 | + uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: build-linux-x64 |
| 78 | + path: output/CefViewCore/ |
| 79 | + |
| 80 | + build_linux_arm64: |
| 81 | + name: Build for Linux (ARM64) |
| 82 | + runs-on: ubuntu-24.04-arm |
| 83 | + steps: |
| 84 | + - name: Checkout |
| 85 | + uses: actions/checkout@v4 |
| 86 | + |
| 87 | + - name: Install Dependencies |
| 88 | + run: | |
| 89 | + sudo apt-get update |
| 90 | + sudo apt-get install -y build-essential clang cmake git libc++-dev libc++abi-dev libx11-dev |
| 91 | +
|
| 92 | + - name: Build |
| 93 | + run: | |
| 94 | + chmod +x Update-LinuxArm64.sh |
| 95 | + ./Update-LinuxArm64.sh |
| 96 | + working-directory: ./scripts |
| 97 | + |
| 98 | + - name: Upload Artifact |
| 99 | + uses: actions/upload-artifact@v4 |
| 100 | + with: |
| 101 | + name: build-linux-arm64 |
| 102 | + path: output/CefViewCore/ |
| 103 | + |
| 104 | + package: |
| 105 | + name: Package All-in-one Artifact |
| 106 | + needs: |
| 107 | + [ |
| 108 | + build_windows_x64, |
| 109 | + build_macos_universal, |
| 110 | + build_linux_x64, |
| 111 | + build_linux_arm64, |
| 112 | + ] |
| 113 | + runs-on: ubuntu-latest |
| 114 | + steps: |
| 115 | + - name: Checkout |
| 116 | + uses: actions/checkout@v4 |
| 117 | + |
| 118 | + - name: Download all artifacts |
| 119 | + uses: actions/download-artifact@v4 |
| 120 | + with: |
| 121 | + path: artifacts |
| 122 | + |
| 123 | + - name: Combine artifacts |
| 124 | + run: | |
| 125 | + mkdir -p final_artifact |
| 126 | + # Recursively copy the contents of each artifact directory |
| 127 | + # The -n/--no-clobber option prevents overwriting files, although conflicts should not happen with this structure |
| 128 | + cp -rT artifacts/build-windows-x64 final_artifact |
| 129 | + cp -rT artifacts/build-macos-universal final_artifact |
| 130 | + cp -rT artifacts/build-linux-x64 final_artifact |
| 131 | + cp -rT artifacts/build-linux-arm64 final_artifact |
| 132 | +
|
| 133 | + - name: Create Version File |
| 134 | + run: cp scripts/ThirdParty-Config.txt final_artifact/VERSION |
| 135 | + |
| 136 | + - name: Upload final artifact |
| 137 | + uses: actions/upload-artifact@v4 |
| 138 | + with: |
| 139 | + name: CefViewCore-binaries |
| 140 | + path: final_artifact/ |
| 141 | + |
| 142 | + release: |
| 143 | + name: Create GitHub Release |
| 144 | + needs: package |
| 145 | + runs-on: ubuntu-latest |
| 146 | + permissions: |
| 147 | + contents: write |
| 148 | + steps: |
| 149 | + - name: Checkout |
| 150 | + uses: actions/checkout@v4 |
| 151 | + |
| 152 | + - name: Download CefViewCore-binaries artifact |
| 153 | + uses: actions/download-artifact@v4 |
| 154 | + with: |
| 155 | + name: CefViewCore-binaries |
| 156 | + path: CefViewCore-binaries |
| 157 | + |
| 158 | + - name: Get versions from config file |
| 159 | + id: versions |
| 160 | + run: | |
| 161 | + CEF_VERSION=$(grep "CEF_VERSION=" scripts/ThirdParty-Config.txt | cut -d'=' -f2) |
| 162 | + CORE_VERSION=$(grep "CORE_VERSION=" scripts/ThirdParty-Config.txt | cut -d'=' -f2) |
| 163 | + CEF_VERSION_MAJOR_MINOR_PATCH=$(echo "$CEF_VERSION" | cut -d'+' -f1) |
| 164 | + CORE_VERSION_SHORT=$(echo "$CORE_VERSION" | cut -c1-7) |
| 165 | + TAG_NAME="${CEF_VERSION_MAJOR_MINOR_PATCH}+${CORE_VERSION_SHORT}" |
| 166 | + echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT |
| 167 | + echo "zip_name=CefViewCore-binaries-${TAG_NAME}.zip" >> $GITHUB_OUTPUT |
| 168 | +
|
| 169 | + - name: Zip the artifact |
| 170 | + run: | |
| 171 | + cd CefViewCore-binaries |
| 172 | + zip -r ../${{ steps.versions.outputs.zip_name }} . |
| 173 | + cd .. |
| 174 | + shell: bash |
| 175 | + |
| 176 | + - name: Create Release |
| 177 | + uses: softprops/action-gh-release@v2 |
| 178 | + with: |
| 179 | + tag_name: ${{ steps.versions.outputs.tag_name }} |
| 180 | + files: ${{ steps.versions.outputs.zip_name }} |
0 commit comments