1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00
rufus/.github/workflows/mingw.yml

99 lines
2.6 KiB
YAML
Raw Normal View History

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:
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:
- { 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
autotools
2021-07-28 23:49:17 +00:00
git
upx
- name: Checkout repository
uses: actions/checkout@v3
2021-07-28 23:49:17 +00:00
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
- 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
2021-07-28 23:49:17 +00:00
- name: Build
run: |
./configure --disable-debug ${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}
2021-07-28 23:49:17 +00:00
make -j4
mv ./src/rufus.exe ./${{ matrix.exe }}
strip ./${{ matrix.exe }}
upx --lzma --best ./${{ matrix.exe }}
- name: Display SHA-256
run: sha256sum ./${{ matrix.exe }}
- name: Upload to VirusTotal
if: ${{ github.event_name == 'push' }}
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 }}
2021-07-28 23:49:17 +00:00
- name: Upload artifacts
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v3
2021-07-28 23:49:17 +00:00
with:
name: MinGW
path: ./*.exe