|
| 1 | +name: Build distribution package |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'release_*' |
| 7 | + |
| 8 | +env: |
| 9 | + QT_VERSION: 5.12.9 |
| 10 | + |
| 11 | +jobs: |
| 12 | + create_release: |
| 13 | + name: Create GitHub release |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Create Release |
| 17 | + id: create_release |
| 18 | + uses: actions/create-release@v1 |
| 19 | + env: |
| 20 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 21 | + with: |
| 22 | + tag_name: ${{ github.ref }} |
| 23 | + release_name: Release ${{ github.ref }} |
| 24 | + draft: false |
| 25 | + prerelease: false |
| 26 | + - name: Store upload URL |
| 27 | + run: | |
| 28 | + echo -n "${{ steps.create_release.outputs.upload_url }}" > upload_url |
| 29 | + - name: Persist upload URL |
| 30 | + uses: actions/upload-artifact@v2 |
| 31 | + with: |
| 32 | + name: upload_url |
| 33 | + path: ${{ github.workspace }}/upload_url |
| 34 | + |
| 35 | + build_linux: |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + configuration: [FastDebug, Release] |
| 39 | + name: Linux |
| 40 | + needs: create_release |
| 41 | + runs-on: ubuntu-latest |
| 42 | + container: ghcr.io/scp-fs2open/linux_build:sha-a8ca321 |
| 43 | + steps: |
| 44 | + - name: Cache Qt |
| 45 | + id: cache-qt-lin |
| 46 | + uses: actions/cache@v1 |
| 47 | + with: |
| 48 | + path: ${{ github.workspace }}/../Qt |
| 49 | + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} |
| 50 | + - name: Install Qt |
| 51 | + uses: jurplel/install-qt-action@v2 |
| 52 | + with: |
| 53 | + version: ${{ env.QT_VERSION }} |
| 54 | + dir: ${{ github.workspace }}/.. |
| 55 | + cached: ${{ steps.cache-qt-lin.outputs.cache-hit }} |
| 56 | + |
| 57 | + - uses: actions/checkout@v1 |
| 58 | + name: Checkout |
| 59 | + with: |
| 60 | + submodules: true |
| 61 | + - name: Configure CMake |
| 62 | + env: |
| 63 | + CONFIGURATION: ${{ matrix.configuration }} |
| 64 | + COMPILER: gcc-5 |
| 65 | + run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh |
| 66 | + - name: Compile |
| 67 | + working-directory: ./build |
| 68 | + env: |
| 69 | + CONFIGURATION: ${{ matrix.configuration }} |
| 70 | + run: | |
| 71 | + LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all |
| 72 | + - name: Run Tests |
| 73 | + working-directory: ./build |
| 74 | + env: |
| 75 | + CONFIGURATION: ${{ matrix.configuration }} |
| 76 | + XDG_RUNTIME_DIR: /root |
| 77 | + run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh |
| 78 | + - name: Generate AppImage |
| 79 | + working-directory: ./build |
| 80 | + env: |
| 81 | + CONFIGURATION: ${{ matrix.configuration }} |
| 82 | + run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install |
| 83 | + - name: Upload build result |
| 84 | + uses: actions/upload-artifact@v2 |
| 85 | + with: |
| 86 | + name: linux-${{ matrix.configuration }} |
| 87 | + path: ${{ github.workspace }}/build/install/*.AppImage |
| 88 | + linux_zip: |
| 89 | + name: Build Linux distribution zip |
| 90 | + needs: build_linux |
| 91 | + runs-on: ubuntu-latest |
| 92 | + container: ghcr.io/scp-fs2open/sftp_upload:sha-dd9d8cf |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v1 |
| 95 | + name: Checkout |
| 96 | + with: |
| 97 | + submodules: true |
| 98 | + fetch-depth: '0' |
| 99 | + - name: Download upload URL |
| 100 | + uses: actions/download-artifact@v1 |
| 101 | + with: |
| 102 | + name: upload_url |
| 103 | + path: . |
| 104 | + - name: Extract upload URL |
| 105 | + id: extractUploadUrl |
| 106 | + run: echo "::set-output name=upload_url::$(cat upload_url)" |
| 107 | + - name: Download Release builds |
| 108 | + uses: actions/download-artifact@v1 |
| 109 | + with: |
| 110 | + name: linux-Release |
| 111 | + path: builds |
| 112 | + - name: Download FastDebug builds |
| 113 | + uses: actions/download-artifact@v2 |
| 114 | + with: |
| 115 | + name: linux-FastDebug |
| 116 | + path: builds |
| 117 | + - name: Create Distribution package |
| 118 | + id: generate_package |
| 119 | + working-directory: ./builds |
| 120 | + run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux |
| 121 | + - name: Upload result package |
| 122 | + uses: actions/upload-release-asset@v1 |
| 123 | + env: |
| 124 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 125 | + with: |
| 126 | + upload_url: ${{ steps.extractUploadUrl.outputs.upload_url }} |
| 127 | + asset_path: ${{ steps.generate_package.outputs.package_path }} |
| 128 | + asset_name: ${{ steps.generate_package.outputs.package_name }} |
| 129 | + # All builds are zips at the moment so this is fine for now |
| 130 | + asset_content_type: application/zip |
| 131 | + |
| 132 | + build_windows: |
| 133 | + strategy: |
| 134 | + matrix: |
| 135 | + configuration: [FastDebug, Release] |
| 136 | + arch: [Win32, x64] |
| 137 | + simd: [SSE2, AVX] |
| 138 | + needs: create_release |
| 139 | + name: Windows |
| 140 | + runs-on: windows-2019 |
| 141 | + steps: |
| 142 | + - uses: actions/checkout@v1 |
| 143 | + name: Checkout |
| 144 | + with: |
| 145 | + submodules: true |
| 146 | + - name: Cache Qt |
| 147 | + id: cache-qt-win |
| 148 | + uses: actions/cache@v1 |
| 149 | + with: |
| 150 | + path: ${{ github.workspace }}/../Qt |
| 151 | + key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }} |
| 152 | + - name: Install Qt (32 bit) |
| 153 | + uses: jurplel/install-qt-action@v2 |
| 154 | + if: ${{ matrix.arch == 'Win32' }} |
| 155 | + with: |
| 156 | + version: ${{ env.QT_VERSION }} |
| 157 | + dir: ${{ github.workspace }}/.. |
| 158 | + arch: win32_msvc2017 |
| 159 | + cached: ${{ steps.cache-qt-win.outputs.cache-hit }} |
| 160 | + aqtversion: ==0.8 |
| 161 | + - name: Install Qt (64 bit) |
| 162 | + uses: jurplel/install-qt-action@v2 |
| 163 | + if: ${{ matrix.arch == 'x64' }} |
| 164 | + with: |
| 165 | + version: ${{ env.QT_VERSION }} |
| 166 | + dir: ${{ github.workspace }}/.. |
| 167 | + arch: win64_msvc2017_64 |
| 168 | + cached: ${{ steps.cache-qt-win.outputs.cache-hit }} |
| 169 | + aqtversion: ==0.8 |
| 170 | + |
| 171 | + - name: Configure CMake |
| 172 | + env: |
| 173 | + CONFIGURATION: ${{ matrix.configuration }} |
| 174 | + ARCHITECTURE: ${{ matrix.arch }} |
| 175 | + SIMD: ${{ matrix.simd }} |
| 176 | + shell: bash |
| 177 | + run: | |
| 178 | + mkdir build |
| 179 | + cd build |
| 180 | +
|
| 181 | + cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \ |
| 182 | + -DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \ |
| 183 | + -DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \ |
| 184 | + -DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \ |
| 185 | + -G "Visual Studio 16 2019" -T "v142" .. |
| 186 | + - name: Compile |
| 187 | + working-directory: ./build |
| 188 | + env: |
| 189 | + CONFIGURATION: ${{ matrix.configuration }} |
| 190 | + COMPILER: ${{ matrix.compiler }} |
| 191 | + shell: bash |
| 192 | + run: | |
| 193 | + cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal |
| 194 | + ls -alR "$(pwd)/install" |
| 195 | + - name: Run Tests |
| 196 | + working-directory: ./build |
| 197 | + env: |
| 198 | + CONFIGURATION: ${{ matrix.configuration }} |
| 199 | + shell: bash |
| 200 | + run: ./bin/$CONFIGURATION/unittests --gtest_shuffle |
| 201 | + - name: Upload build result |
| 202 | + uses: actions/upload-artifact@v2 |
| 203 | + with: |
| 204 | + name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }} |
| 205 | + path: ${{ github.workspace }}/build/install/* |
| 206 | + windows_zip: |
| 207 | + name: Build Windows distribution zip |
| 208 | + needs: build_windows |
| 209 | + runs-on: ubuntu-latest |
| 210 | + container: ghcr.io/scp-fs2open/sftp_upload:sha-dd9d8cf |
| 211 | + strategy: |
| 212 | + matrix: |
| 213 | + arch: [Win32, x64] |
| 214 | + simd: [SSE2, AVX] |
| 215 | + steps: |
| 216 | + - uses: actions/checkout@v1 |
| 217 | + name: Checkout |
| 218 | + with: |
| 219 | + submodules: true |
| 220 | + fetch-depth: '0' |
| 221 | + - name: Download upload URL |
| 222 | + uses: actions/download-artifact@v1 |
| 223 | + with: |
| 224 | + name: upload_url |
| 225 | + path: . |
| 226 | + - name: Extract upload URL |
| 227 | + id: extractUploadUrl |
| 228 | + run: echo "::set-output name=upload_url::$(cat upload_url)" |
| 229 | + - name: Download Release builds |
| 230 | + uses: actions/download-artifact@v1 |
| 231 | + with: |
| 232 | + name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }} |
| 233 | + path: builds |
| 234 | + - name: Download FastDebug builds |
| 235 | + uses: actions/download-artifact@v2 |
| 236 | + with: |
| 237 | + name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }} |
| 238 | + path: builds |
| 239 | + - name: Create Distribution package |
| 240 | + id: generate_package |
| 241 | + working-directory: ./builds |
| 242 | + shell: bash |
| 243 | + env: |
| 244 | + ARCH: ${{ matrix.arch }} |
| 245 | + SIMD: ${{ matrix.simd }} |
| 246 | + run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows |
| 247 | + - name: Upload result package |
| 248 | + uses: actions/upload-release-asset@v1 |
| 249 | + env: |
| 250 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 251 | + with: |
| 252 | + upload_url: ${{ steps.extractUploadUrl.outputs.upload_url }} |
| 253 | + asset_path: ${{ steps.generate_package.outputs.package_path }} |
| 254 | + asset_name: ${{ steps.generate_package.outputs.package_name }} |
| 255 | + # All builds are zips at the moment so this is fine for now |
| 256 | + asset_content_type: application/zip |
0 commit comments