2021-07-28 23:49:17 +00:00
|
|
|
name: MinGW
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
jobs:
|
2021-09-03 23:55:59 +00:00
|
|
|
MinGW-Build:
|
2021-07-28 23:49:17 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-04-22 14:46:03 +00:00
|
|
|
- { sys: mingw64, env: x86_64, exe: rufus.exe }
|
|
|
|
- { sys: mingw32, env: i686, exe: rufus_x86.exe }
|
2021-07-28 23:49:17 +00:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Install MinGW
|
|
|
|
uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
2021-09-07 00:01:56 +00:00
|
|
|
msystem: ${{ matrix.sys }}
|
2021-07-28 23:49:17 +00:00
|
|
|
update: true
|
|
|
|
install: >-
|
2021-09-07 00:01:56 +00:00
|
|
|
mingw-w64-${{ matrix.env }}-toolchain
|
2021-07-28 23:49:17 +00:00
|
|
|
base-devel
|
2022-01-05 12:46:48 +00:00
|
|
|
autotools
|
2021-07-28 23:49:17 +00:00
|
|
|
git
|
|
|
|
upx
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2021-09-28 15:03:36 +00:00
|
|
|
- name: Set ALPHA
|
|
|
|
id: set_alpha
|
2022-12-15 17:40:02 +00:00
|
|
|
shell: bash
|
2021-09-28 15:03:36 +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=--enable-alpha" >> $GITHUB_OUTPUT
|
|
|
|
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (ALPHA)"/' ./src/rufus.rc
|
2021-09-28 15:03:36 +00:00
|
|
|
|
|
|
|
- name: Set BETA
|
|
|
|
id: set_beta
|
2022-12-15 17:40:02 +00:00
|
|
|
shell: bash
|
2021-09-28 15:03:36 +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=--enable-beta" >> $GITHUB_OUTPUT
|
|
|
|
sed -b -i 's/VALUE "InternalName", "Rufus"/VALUE "InternalName", "Rufus (BETA)"/' ./src/rufus.rc
|
2021-09-28 15:03:36 +00:00
|
|
|
|
2021-07-28 23:49:17 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2021-09-28 15:03:36 +00:00
|
|
|
./configure --disable-debug ${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}
|
2021-07-28 23:49:17 +00:00
|
|
|
make -j4
|
2023-04-22 14:46:03 +00:00
|
|
|
mv ./src/rufus.exe ./${{ matrix.exe }}
|
|
|
|
strip ./${{ matrix.exe }}
|
|
|
|
upx --lzma --best ./${{ matrix.exe }}
|
2021-07-29 13:36:09 +00:00
|
|
|
|
|
|
|
- name: Display SHA-256
|
2023-04-22 14:46:03 +00:00
|
|
|
run: sha256sum ./${{ matrix.exe }}
|
2021-07-29 13:36:09 +00:00
|
|
|
|
|
|
|
- name: Upload to VirusTotal
|
2023-04-25 23:00:02 +00:00
|
|
|
if: ${{ github.event_name == 'push' && matrix.env == 'x86_64' }}
|
2022-02-04 17:41:44 +00:00
|
|
|
continue-on-error: true
|
2021-07-29 13:36:09 +00:00
|
|
|
run: |
|
2023-04-22 14:46:03 +00:00
|
|
|
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 }}
|
2021-07-28 23:49:17 +00:00
|
|
|
|
|
|
|
- name: Upload artifacts
|
2023-04-22 14:46:03 +00:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
2024-02-07 19:49:41 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-07-28 23:49:17 +00:00
|
|
|
with:
|
2024-02-07 19:49:41 +00:00
|
|
|
name: ${{ matrix.sys }}
|
2021-07-28 23:49:17 +00:00
|
|
|
path: ./*.exe
|
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: MinGW-Build
|
|
|
|
steps:
|
|
|
|
- name: Merge Artifacts
|
|
|
|
uses: actions/upload-artifact/merge@v4
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
|
|
|
with:
|
|
|
|
name: MinGW
|
|
|
|
delete-merged: true
|