|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: windows_build |
| 4 | + |
| 5 | +env: |
| 6 | + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
| 7 | + BUILD_TYPE: Release |
| 8 | + |
| 9 | +# Controls when the workflow will run |
| 10 | +on: |
| 11 | + # Triggers the workflow on push or pull request events but only for the main branch |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + runs-on: windows-2019 |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + submodules: 'true' |
| 23 | + fetch-depth: 0 |
| 24 | + |
| 25 | + - name: Gets latest created release info |
| 26 | + id: latest_release_info |
| 27 | + uses: jossef/action-latest-release-info@v1.1.0 |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ github.token }} |
| 30 | + |
| 31 | + - name: EASTL special treatment |
| 32 | + run: | |
| 33 | + cd lib/EASTL |
| 34 | + git submodule update --init |
| 35 | +
|
| 36 | + - name: Create Build Environment |
| 37 | + run: cmake -E make_directory ${{runner.workspace}}/build |
| 38 | + |
| 39 | + - name: Configure CMake |
| 40 | + shell: bash |
| 41 | + working-directory: ${{runner.workspace}}/build |
| 42 | + # Note the current convention is to use the -S and -B options here to specify source |
| 43 | + # and build directories, but this is only available with CMake 3.13 and higher. |
| 44 | + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
| 45 | + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Visual Studio 16 2019" -A x64 |
| 46 | + |
| 47 | + - name: Build OFS |
| 48 | + working-directory: ${{runner.workspace}}/build |
| 49 | + shell: bash |
| 50 | + run: | |
| 51 | + cmake --build . --config $BUILD_TYPE --target "OpenFunscripter" |
| 52 | +
|
| 53 | + |
| 54 | + - name: FFMPEG & Zip |
| 55 | + run: | |
| 56 | + choco install -y -r --no-progress 7zip |
| 57 | + choco install -y -r --no-progress InnoSetup |
| 58 | + powershell Invoke-WebRequest -Uri "https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z" -OutFile "${{runner.workspace}}\ffmpeg.7z" |
| 59 | +
|
| 60 | + mkdir "${{runner.workspace}}\ffmpeg" |
| 61 | + 7z e "${{runner.workspace}}\ffmpeg.7z" -o${{runner.workspace}}\ffmpeg |
| 62 | + cp "${{runner.workspace}}\ffmpeg\ffmpeg.exe" "${{runner.workspace}}\OFS\bin\Release\ffmpeg.exe" |
| 63 | + powershell Compress-Archive "${{runner.workspace}}\OFS\bin\Release" "${{runner.workspace}}\OFS-64x_${{github.sha}}.zip" |
| 64 | +
|
| 65 | +# - uses: actions/upload-artifact@v2 |
| 66 | +# with: |
| 67 | +# name: OFS-64x_${{github.sha}}.zip |
| 68 | +# path: ${{runner.workspace}}\OFS-64x_${{github.sha}}.zip |
| 69 | + |
| 70 | + - name: Installer |
| 71 | + run: iscc "${{runner.workspace}}\OFS\ofs-installer.iss" |
| 72 | + |
| 73 | +# - uses: actions/upload-artifact@v2 |
| 74 | +# with: |
| 75 | +# name: OFS-64x_${{github.sha}}.exe |
| 76 | +# path: ${{runner.workspace}}\OFS\installer\ofs-installer.exe |
| 77 | + |
| 78 | + - name: Upload Release Zip |
| 79 | + id: upload-release-zip |
| 80 | + uses: actions/upload-release-asset@v1 |
| 81 | + env: |
| 82 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + with: |
| 84 | + upload_url: ${{ steps.latest_release_info.outputs.upload_url }} |
| 85 | + asset_path: ${{runner.workspace}}\OFS-64x_${{github.sha}}.zip |
| 86 | + asset_name: OFS-64x_${{github.sha}}.zip |
| 87 | + asset_content_type: application/octet-stream |
| 88 | + |
| 89 | + - name: Upload Release Installer |
| 90 | + id: upload-release-installer |
| 91 | + uses: actions/upload-release-asset@v1 |
| 92 | + env: |
| 93 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + with: |
| 95 | + upload_url: ${{ steps.latest_release_info.outputs.upload_url }} |
| 96 | + asset_path: ${{runner.workspace}}\OFS\installer\ofs-installer.exe |
| 97 | + asset_name: OFS-64x_${{github.sha}}.exe |
| 98 | + asset_content_type: application/octet-stream |
0 commit comments