porymap/.github/workflows/main.yml

153 lines
4.7 KiB
YAML
Raw Normal View History

2020-12-11 22:45:30 +00:00
name: Build Porymap
permissions:
contents: write
2020-12-11 22:45:30 +00:00
on:
push:
branches:
- master
tags:
- '*'
2020-12-11 22:45:30 +00:00
pull_request:
branches:
- master
2020-12-11 22:45:30 +00:00
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
2023-02-20 17:39:41 +00:00
build-qt5-linux:
runs-on: ubuntu-latest
2020-12-11 22:45:30 +00:00
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2024-12-18 17:17:12 +00:00
- uses: actions/checkout@v4
2020-12-11 22:45:30 +00:00
- name: Install Qt
2024-12-18 17:17:12 +00:00
uses: jurplel/install-qt-action@v4
2020-12-11 22:45:30 +00:00
with:
version: '5.14.2'
2024-12-18 17:17:12 +00:00
modules: 'qtcharts'
cache: 'true'
2020-12-11 22:45:30 +00:00
- name: Configure
run: qmake porymap.pro
- name: Compile
run: make
2023-02-20 17:39:41 +00:00
build-macos:
2024-12-22 21:54:33 +00:00
strategy:
matrix:
os: [macos-latest, macos-13]
runs-on: ${{ matrix.os }}
env:
BUILD_NAME: porymap-${{ matrix.os }}-${{ github.ref_name }}
2023-02-20 17:39:41 +00:00
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2024-12-18 17:17:12 +00:00
- uses: actions/checkout@v4
2023-02-20 17:39:41 +00:00
- name: Install Qt
2024-12-18 17:17:12 +00:00
uses: jurplel/install-qt-action@v4
2023-02-20 17:39:41 +00:00
with:
version: '6.7.*'
modules: 'qtcharts'
2024-12-18 17:17:12 +00:00
cache: 'true'
2023-02-20 17:39:41 +00:00
- name: Configure
run: qmake -config release porymap.pro
- name: Compile
run: make
2023-02-20 19:21:35 +00:00
- name: Create Disk Image
2023-02-20 17:39:41 +00:00
if: startsWith(github.ref, 'refs/tags/')
2023-02-21 00:35:25 +00:00
run: macdeployqt porymap.app -dmg
2023-02-20 17:39:41 +00:00
2023-02-20 19:21:35 +00:00
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
2024-12-22 21:54:33 +00:00
mkdir $BUILD_NAME
cp porymap.dmg $BUILD_NAME/porymap.dmg
cp RELEASE-README.txt $BUILD_NAME/README.txt
2023-02-20 19:21:35 +00:00
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
2024-12-22 21:54:33 +00:00
run: zip -r $BUILD_NAME.zip $BUILD_NAME
2023-02-20 19:21:35 +00:00
2023-02-20 17:39:41 +00:00
- name: Release
2024-12-18 17:17:12 +00:00
uses: softprops/action-gh-release@v2
2023-02-20 17:39:41 +00:00
if: startsWith(github.ref, 'refs/tags/')
with:
2024-12-22 21:54:33 +00:00
files: $BUILD_NAME.zip
2023-02-20 17:39:41 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-static-windows:
runs-on: windows-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2024-12-18 17:17:12 +00:00
- uses: actions/checkout@v4
- uses: dsaltares/fetch-gh-release-asset@master
if: steps.cache-static-qt.outputs.cache-hit != 'true'
with:
repo: 'huderlem/porymap'
version: 'tags/qt-static-6.0.1-windows'
file: 'Qt-Static-Windows-mingw-6.0.1.zip'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip Static Qt
if: steps.cache-static-qt.outputs.cache-hit != 'true'
run: powershell.exe -Command "Expand-Archive -Path Qt-Static-Windows-mingw-6.0.1.zip -DestinationPath ../Qt"
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'huderlem/porymap'
version: 'tags/qt-static-6.0.1-windows'
file: 'mingw810_64.zip'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip mingw
run: powershell.exe -Command "Expand-Archive -Path mingw810_64.zip -DestinationPath ../mingw810_64"
- name: Add Qt Static to PATH
run: echo "$env:GITHUB_WORKSPACE/../Qt/6.0.1/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add static config to .pro file
run: echo "CONFIG += qt static" >> porymap.pro
- name: Add static qmake flags to .pro file
run: echo "QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -static -lwinpthread" >> porymap.pro
- name: Run Qmake
env:
QTDIR: ../Qt/6.0.1
run: qmake.exe -o Makefile porymap.pro -spec win32-g++ "CONFIG+=qtquickcompiler"
- name: Add mingw to PATH
run: echo "$env:GITHUB_WORKSPACE/../mingw810_64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Compile
env:
QTDIR: ../Qt/6.0.1
run: mingw32-make.exe -j8
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir porymap-windows-${{ github.ref_name }}
cp release/porymap.exe porymap-windows-${{ github.ref_name }}/porymap.exe
cp RELEASE-README.txt porymap-windows-${{ github.ref_name }}/README.txt
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
2023-02-21 00:35:25 +00:00
run: powershell.exe -Command "Compress-Archive -Path porymap-windows-${{ github.ref_name }} -DestinationPath porymap-windows-${{ github.ref_name }}.zip"
- name: Create Release
2024-12-18 17:17:12 +00:00
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: porymap-windows-${{ github.ref_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}