[wue] add an option to perform a fully unattended/silent install #574
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MinGW | |
| on: | |
| push: | |
| paths-ignore: | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - '.gitignore' | |
| - '.gitattributes' | |
| - 'res/**' | |
| - '**.cmd' | |
| - '**.md' | |
| - '**.rc' | |
| - '**.sh' | |
| - '**.txt' | |
| - '**.xml' | |
| pull_request: | |
| branches: [master] | |
| paths-ignore: | |
| - '.gitignore' | |
| - '.gitattributes' | |
| - 'res/**' | |
| - '**.cmd' | |
| - '**.md' | |
| - '**.rc' | |
| - '**.sh' | |
| - '**.txt' | |
| - '**.xml' | |
| jobs: | |
| MinGW-Build: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - { sys: mingw64, env: x86_64, exe: rufus.exe } | |
| - { sys: mingw32, env: i686, exe: rufus_x86.exe } | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Install MinGW | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.sys }} | |
| update: true | |
| install: >- | |
| mingw-w64-${{ matrix.env }}-toolchain | |
| base-devel | |
| autotools | |
| git | |
| upx | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set ALPHA | |
| id: set_alpha | |
| shell: bash | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT | |
| run: | | |
| echo "option=--enable-alpha" >> $GITHUB_OUTPUT | |
| sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (ALPHA)"/' ./src/rufus.rc | |
| - name: Set BETA | |
| id: set_beta | |
| shell: bash | |
| if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }} | |
| # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT | |
| run: | | |
| echo "option=--enable-beta" >> $GITHUB_OUTPUT | |
| sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (BETA)"/' ./src/rufus.rc | |
| - name: Build | |
| run: | | |
| ./configure --disable-debug ${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }} | |
| make -j4 | |
| mv ./src/rufus.exe ./${{ matrix.exe }} | |
| strip ./${{ matrix.exe }} | |
| upx --lzma --best ./${{ matrix.exe }} | |
| - name: Prepare to sign ALPHA | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| shell: bash | |
| # NB: The Base64 encoded variable should not have line breaks or this will fail! | |
| run: echo ${{ secrets.RUFUS_GITHUB_OFFICIAL_BUILD }} | base64 -di > ./sign.pfx | |
| - name: Add signtool to path | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| uses: KamaranL/add-signtool-action@v1 | |
| - name: Sign ALPHA | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| shell: cmd | |
| run: | | |
| signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ${{ matrix.exe }} | |
| del sign.pfx | |
| - name: Display SHA-256 | |
| run: sha256sum ./${{ matrix.exe }} | |
| - name: Upload to VirusTotal | |
| if: ${{ github.event_name == 'push' && matrix.env == 'x86_64' }} | |
| continue-on-error: true | |
| run: | | |
| curl --request POST --url https://www.virustotal.com/vtapi/v2/file/scan --form apikey=${{ secrets.VIRUSTOTAL_API_KEY }} --form file=@./${{ matrix.exe }} | |
| curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/${{ matrix.exe }}' --form file=@./${{ matrix.exe }} | |
| - name: Upload artifacts | |
| if: ${{ github.event_name == 'push' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.sys }} | |
| path: ./*.exe | |
| Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility: | |
| runs-on: windows-latest | |
| needs: MinGW-Build | |
| steps: | |
| - name: Merge Artifacts | |
| uses: actions/upload-artifact/merge@v7 | |
| if: ${{ github.event_name == 'push' }} | |
| with: | |
| name: MinGW | |
| delete-merged: true |