mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
* Closes #2113 * Also fix a broken URL * PS: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ is *WOEFULLY* incomplete, in that it doesn't tell you that: 1. The new method of setting output is *NO LONGER* shell agnostic (i.e *REGRESSION*) 2. You need to use bash for the new $GITHUB_OUTPUT to work
98 lines
2.5 KiB
YAML
98 lines
2.5 KiB
YAML
name: MinGW
|
|
|
|
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'
|
|
|
|
jobs:
|
|
MinGW-Build:
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- { sys: mingw64, env: x86_64 }
|
|
- { sys: mingw32, env: i686 }
|
|
|
|
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@v3
|
|
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
|
|
|
|
- name: Build
|
|
run: |
|
|
./configure --disable-debug ${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}
|
|
make -j4
|
|
mv ./src/rufus.exe .
|
|
strip ./rufus.exe
|
|
upx --lzma --best ./rufus.exe
|
|
|
|
- name: Display SHA-256
|
|
run: sha256sum ./rufus.exe
|
|
|
|
- name: Upload to VirusTotal
|
|
continue-on-error: true
|
|
if: ${{ matrix.env == 'i686' && 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.exe
|
|
curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus.exe' --form file=@./rufus.exe
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ matrix.env == 'i686' && github.event_name == 'push' }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: MinGW
|
|
path: ./*.exe
|