2021-11-16 17:50:20 +00:00
|
|
|
name: VS2022
|
2021-07-28 23:49:17 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.gitignore'
|
|
|
|
- '.gitattributes'
|
|
|
|
- 'res/**'
|
|
|
|
- '**.cmd'
|
|
|
|
- '**.md'
|
|
|
|
- '**.rc'
|
|
|
|
- '**.sh'
|
|
|
|
- '**.txt'
|
|
|
|
- '**.xml'
|
|
|
|
pull_request:
|
2021-09-28 15:03:36 +00:00
|
|
|
branches: [master]
|
2021-07-28 23:49:17 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '.gitignore'
|
|
|
|
- '.gitattributes'
|
|
|
|
- 'res/**'
|
|
|
|
- '**.cmd'
|
|
|
|
- '**.md'
|
|
|
|
- '**.rc'
|
|
|
|
- '**.sh'
|
|
|
|
- '**.txt'
|
|
|
|
- '**.xml'
|
|
|
|
|
|
|
|
env:
|
|
|
|
SOLUTION_FILE_PATH: ./rufus.sln
|
2021-09-07 00:01:56 +00:00
|
|
|
BUILD_CONFIGURATION: Release
|
2021-07-28 23:49:17 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-11-16 17:50:20 +00:00
|
|
|
VS2022-Build:
|
2022-05-31 15:30:19 +00:00
|
|
|
runs-on: windows-latest
|
2021-07-28 23:49:17 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
TARGET_PLATFORM: [x64, x86, arm64, arm]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-08 16:13:30 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-07-28 23:49:17 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: Add MSBuild to PATH
|
2024-02-07 19:24:17 +00:00
|
|
|
uses: microsoft/setup-msbuild@v2
|
2021-11-16 17:50:20 +00:00
|
|
|
with:
|
|
|
|
msbuild-architecture: x64
|
2021-07-28 23:49:17 +00:00
|
|
|
|
2021-09-28 18:47:09 +00:00
|
|
|
- name: Set ALPHA
|
|
|
|
id: set_alpha
|
2022-12-15 17:40:02 +00:00
|
|
|
shell: bash
|
2021-09-28 18:47:09 +00:00
|
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
2022-12-15 17:40:02 +00:00
|
|
|
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
|
2024-01-17 20:42:59 +00:00
|
|
|
run: |
|
|
|
|
echo "option=/DALPHA" >> $GITHUB_OUTPUT
|
|
|
|
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (ALPHA)"/' ./src/rufus.rc
|
2021-09-28 18:47:09 +00:00
|
|
|
|
|
|
|
- name: Set BETA
|
|
|
|
id: set_beta
|
2022-12-15 17:40:02 +00:00
|
|
|
shell: bash
|
2021-09-28 18:47:09 +00:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }}
|
2022-12-15 17:40:02 +00:00
|
|
|
# This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT
|
2024-01-17 20:42:59 +00:00
|
|
|
run: |
|
|
|
|
echo "option=/DBETA" >> $GITHUB_OUTPUT
|
|
|
|
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (BETA)"/' ./src/rufus.rc
|
2021-09-28 18:47:09 +00:00
|
|
|
|
2021-07-28 23:49:17 +00:00
|
|
|
- name: Build
|
2021-09-28 18:47:09 +00:00
|
|
|
shell: cmd
|
2021-07-28 23:49:17 +00:00
|
|
|
run: |
|
2021-09-28 18:47:09 +00:00
|
|
|
set ExternalCompilerOptions=${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}
|
2023-01-30 19:21:08 +00:00
|
|
|
msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }},ForceImportBeforeCppTargets=%GITHUB_WORKSPACE%\.vs\Generate.PDB.props
|
2021-09-28 18:47:09 +00:00
|
|
|
move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.exe .\rufus_${{ matrix.TARGET_PLATFORM }}.exe
|
2023-01-30 19:21:08 +00:00
|
|
|
move .\${{ matrix.TARGET_PLATFORM }}\Release\rufus.pdb .\rufus_${{ matrix.TARGET_PLATFORM }}.pdb
|
2021-07-28 23:49:17 +00:00
|
|
|
|
2021-07-29 13:36:09 +00:00
|
|
|
- name: Display SHA-256
|
2021-09-07 00:01:56 +00:00
|
|
|
run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe
|
2021-07-29 13:36:09 +00:00
|
|
|
|
|
|
|
- name: Upload to VirusTotal
|
2022-02-04 17:41:44 +00:00
|
|
|
continue-on-error: true
|
2021-07-29 13:36:09 +00:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
run: |
|
2021-09-07 00:01:56 +00:00
|
|
|
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
|
2021-07-29 13:36:09 +00:00
|
|
|
|
2021-07-28 23:49:17 +00:00
|
|
|
- name: Upload artifacts
|
2024-02-07 19:49:41 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-07-29 13:36:09 +00:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
2021-07-28 23:49:17 +00:00
|
|
|
with:
|
2024-02-07 19:49:41 +00:00
|
|
|
name: ${{ matrix.TARGET_PLATFORM }}
|
2023-01-30 19:21:08 +00:00
|
|
|
path: |
|
|
|
|
./*.exe
|
|
|
|
./*.pdb
|
2024-02-07 19:49:41 +00:00
|
|
|
|
|
|
|
Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility:
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: VS2022-Build
|
|
|
|
steps:
|
|
|
|
- name: Merge Artifacts
|
|
|
|
uses: actions/upload-artifact/merge@v4
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
with:
|
|
|
|
name: VS2022
|
|
|
|
delete-merged: true
|