name: VS2022 on: push: paths-ignore: - '.gitignore' - '.gitattributes' - 'res/**' - '**.cmd' - '**.md' - '**.rc' - '**.sh' - '**.txt' - '**.xml' pull_request: branches: [master] paths-ignore: - '.gitignore' - '.gitattributes' - 'res/**' - '**.cmd' - '**.md' - '**.rc' - '**.sh' - '**.txt' - '**.xml' env: SOLUTION_FILE_PATH: ./rufus.sln BUILD_CONFIGURATION: Release jobs: VS2022-Build: runs-on: windows-latest strategy: matrix: TARGET_PLATFORM: [x64, x86, arm64, arm] steps: - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.1 with: msbuild-architecture: x64 - name: Set ALPHA id: set_alpha if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: echo "::set-output name=option::/DALPHA" - name: Set BETA id: set_beta if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }} run: echo "::set-output name=option::/DBETA" - name: Build shell: cmd run: | set ExternalCompilerOptions=${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }} msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }} move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.exe .\rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Display SHA-256 run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload to VirusTotal continue-on-error: true if: ${{ github.event_name == 'push' }} run: | curl --request POST --url https://www.virustotal.com/vtapi/v2/file/scan --form apikey=${{ secrets.VIRUSTOTAL_API_KEY }} --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe - name: Upload artifacts uses: actions/upload-artifact@v3 if: ${{ github.event_name == 'push' }} with: name: VS2022 path: ./*.exe