|
| 1 | +name: Build Binaries |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + binary_version: |
| 10 | + description: 'Binary version' |
| 11 | + type: string |
| 12 | + required: true |
| 13 | + platform: |
| 14 | + description: 'Platform' |
| 15 | + required: true |
| 16 | + default: 'none' |
| 17 | + type: choice |
| 18 | + options: |
| 19 | + - None |
| 20 | + - All platforms |
| 21 | + - Windows (All) |
| 22 | + - Windows 64-bit |
| 23 | + - Windows 32-bit |
| 24 | + - MacOS |
| 25 | + - Linux |
| 26 | + |
| 27 | +env: |
| 28 | + BINARY_VERSION: ${{ inputs.binary_version }} |
| 29 | + |
| 30 | +jobs: |
| 31 | + windows_64: |
| 32 | + runs-on: windows-2022 |
| 33 | + if: ${{ inputs.platform == 'Windows 64-bit' || inputs.platform == 'Windows (All)' || inputs.platform == 'All platforms' }} |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + submodules: 'true' |
| 38 | + - run: choco install innosetup |
| 39 | + - name: Set up JDK 8 |
| 40 | + uses: actions/setup-java@v4 |
| 41 | + with: |
| 42 | + java-version: 8 |
| 43 | + distribution: temurin |
| 44 | + - name: Packr Windows x64 |
| 45 | + shell: bash |
| 46 | + run: ./binaries/build-scripts/win64.sh |
| 47 | + - name: Create Win64 version file |
| 48 | + run: echo ${{ inputs.binary_version }} >> version_windows_64.txt |
| 49 | + - name: Upload Win64 build artifact |
| 50 | + uses: actions/upload-artifact@v4 |
| 51 | + with: |
| 52 | + name: artifacts-win64 |
| 53 | + path: | |
| 54 | + RSCPlusSetup.exe |
| 55 | + version_windows_64.txt |
| 56 | + if-no-files-found: error |
| 57 | + |
| 58 | + windows_32_xp: |
| 59 | + runs-on: windows-2022 |
| 60 | + if: ${{ inputs.platform == 'Windows 32-bit' || inputs.platform == 'Windows (All)' || inputs.platform == 'All platforms' }} |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + submodules: 'true' |
| 65 | + - run: choco install innosetup --version=5.6.1.20190126 --allow-downgrade --force |
| 66 | + - name: Set up JDK 8 |
| 67 | + uses: actions/setup-java@v4 |
| 68 | + with: |
| 69 | + java-version: 8 |
| 70 | + distribution: temurin |
| 71 | + - name: Launch4j Windows x86 |
| 72 | + shell: bash |
| 73 | + run: ./binaries/build-scripts/win32.sh |
| 74 | + - name: Create Win32 version file |
| 75 | + run: echo ${{ inputs.binary_version }} >> version_windows_32.txt |
| 76 | + - name: Upload Win32 build artifact |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + with: |
| 79 | + name: artifacts-win32 |
| 80 | + path: | |
| 81 | + RSCPlusSetup32.exe |
| 82 | + version_windows_32.txt |
| 83 | + if-no-files-found: error |
| 84 | + |
| 85 | + linux: |
| 86 | + runs-on: ubuntu-20.04 |
| 87 | + if: ${{ inputs.platform == 'Linux' || inputs.platform == 'All platforms' }} |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v4 |
| 90 | + - name: Set up JDK 8 |
| 91 | + uses: actions/setup-java@v4 |
| 92 | + with: |
| 93 | + java-version: 8 |
| 94 | + distribution: temurin |
| 95 | + - name: Packr Linux x86_64 |
| 96 | + run: ./binaries/build-scripts/linux-x86_64.sh |
| 97 | + - name: Create Linux version file |
| 98 | + run: echo ${{ inputs.binary_version }} >> version_linux_appimage.txt |
| 99 | + - name: Upload Linux build artifact |
| 100 | + uses: actions/upload-artifact@v4 |
| 101 | + with: |
| 102 | + name: artifacts-linux |
| 103 | + path: | |
| 104 | + RSCPlus.AppImage |
| 105 | + version_linux_appimage.txt |
| 106 | + if-no-files-found: error |
| 107 | + |
| 108 | + macos: |
| 109 | + runs-on: macos-13 |
| 110 | + if: ${{ inputs.platform == 'MacOS' || inputs.platform == 'All platforms' }} |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@v4 |
| 113 | + - name: Set up JDK 8 |
| 114 | + uses: actions/setup-java@v4 |
| 115 | + with: |
| 116 | + java-version: 8 |
| 117 | + distribution: temurin |
| 118 | + - run: git clone https://github.com/RSCPlus/create-dmg |
| 119 | + - run: | |
| 120 | + set -e |
| 121 | + cd create-dmg |
| 122 | + npm install |
| 123 | + ln -s cli.js create-dmg |
| 124 | + chmod +x create-dmg |
| 125 | + - run: echo create-dmg >> $GITHUB_PATH |
| 126 | + - name: Packr MacOS x64 |
| 127 | + run: ./binaries/build-scripts/macos-x64.sh |
| 128 | + - name: Packr MacOS aarch64 |
| 129 | + run: ./binaries/build-scripts/macos-aarch64.sh |
| 130 | + - name: Create MacOS version file |
| 131 | + run: echo ${{ inputs.binary_version }} >> version_macos.txt |
| 132 | + - name: Upload MacOS build artifacts |
| 133 | + uses: actions/upload-artifact@v4 |
| 134 | + with: |
| 135 | + name: artifacts-macos |
| 136 | + path: | |
| 137 | + RSCPlus-x64.dmg |
| 138 | + RSCPlus-aarch64.dmg |
| 139 | + version_macos.txt |
| 140 | + if-no-files-found: error |
| 141 | + |
| 142 | + pre_release: |
| 143 | + runs-on: ubuntu-20.04 |
| 144 | + if: always() |
| 145 | + needs: [ windows_64, windows_32_xp, linux, macos ] |
| 146 | + steps: |
| 147 | + - name: Retrieve all built artifacts |
| 148 | + uses: actions/download-artifact@v4 |
| 149 | + with: |
| 150 | + merge-multiple: true |
| 151 | + path: pre-release |
| 152 | + - name: Verify artifacts available |
| 153 | + run: | |
| 154 | + if [ $(ls | wc -l) == 0 ]; then |
| 155 | + echo "Exiting; No artifacts were found" |
| 156 | + exit 1 |
| 157 | + fi |
| 158 | + - name: Set current date as env variable |
| 159 | + run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV |
| 160 | + - name: Bundle all artifacts |
| 161 | + uses: vimtor/action-zip@v1.2 |
| 162 | + with: |
| 163 | + files: pre-release/ |
| 164 | + recursive: true |
| 165 | + dest: rscplus-${{env.NOW}}.zip |
| 166 | + - name: Pre-release built artifacts |
| 167 | + uses: softprops/action-gh-release@v2 |
| 168 | + with: |
| 169 | + files: | |
| 170 | + rscplus-${{env.NOW}}.zip |
| 171 | + fail_on_unmatched_files: true |
| 172 | + make_latest: false |
| 173 | + prerelease: true |
| 174 | + tag_name: binaries-pre-release |
| 175 | + - name: Cleanup artifacts |
| 176 | + uses: geekyeggo/delete-artifact@v5 |
| 177 | + with: |
| 178 | + name: | |
| 179 | + artifacts-* |
0 commit comments