Texture Editor #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- "*" | |
tags: | |
- "*" | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
build_windows: | |
name: Build (Windows) | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Get latest CMake | |
uses: lukka/get-cmake@latest | |
- name: Install Qt6 | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.4.1' | |
host: 'windows' | |
target: 'desktop' | |
arch: 'win64_msvc2019_64' | |
install-deps: 'true' | |
modules: 'qt3d' | |
- name: Install Conan | |
id: conan | |
uses: turtlebrowser/get-conan@main | |
with: | |
version: 2.0.9 | |
- name: Make build folder and install Conan dependencies | |
run: | | |
mkdir build | |
conan profile detect --force | |
conan install . --output-folder=build --build=missing -s build_type=Release | |
- name: Generate projects | |
run: | | |
cd build | |
cmake --version | |
cmake -G "Visual Studio 16 2019" .. | |
- name: Build project | |
run: | | |
cd build | |
cmake --build . --config Release | |
- name: Move assets to distribution folder | |
run: | | |
mkdir dist | |
mv build/Release/BMEdit.exe dist | |
mv build/Release/*.dll dist | |
mv build/Release/styles dist/styles | |
mv build/Release/platforms dist/platforms | |
mv build/Release/networkinformation dist/networkinformation | |
mv build/Release/tls dist/tls | |
mv build/Release/imageformats dist/imageformats | |
mv build/Release/iconengines dist/iconengines | |
mv Assets/g1 dist/g1 | |
mv Assets/scripts dist/scripts | |
mv Assets/TypesRegistry.json dist | |
mv README.md dist | |
- name: Upload build artifacts - BMEdit | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "BMEdit" | |
path: dist | |
create_release: | |
name: Create release | |
needs: [build_windows] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Create release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.VERSION }} | |
release_name: ${{ steps.get_version.outputs.VERSION }} | |
draft: true | |
prerelease: ${{ contains(github.ref, '-pre') }} | |
outputs: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
upload_release_asset: | |
name: Upload release asset | |
needs: [create_release] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
artifact: [ "BMEdit" ] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ matrix.artifact }} | |
path: ${{ matrix.artifact }} | |
- name: Package artifact for release | |
run: | | |
cd ${{ matrix.artifact }} | |
zip -r ${{ matrix.artifact }}.zip * | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ${{ matrix.artifact }}/${{ matrix.artifact }}.zip | |
asset_name: ${{ matrix.artifact }}.zip | |
asset_content_type: application/zip |