Update packages.yml #30
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 Packages | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'appveyor.yml' | |
- '.travis.yml' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'appveyor.yml' | |
- '.travis.yml' | |
env: | |
QBS_VERSION: 2.0.2 | |
TILED_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
TILED_SNAPSHOT: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
jobs: | |
version: | |
name: Determine Tiled version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
release: ${{ steps.get-version.outputs.release }} | |
steps: | |
- name: Get version | |
id: get-version | |
run: | | |
if [[ "$TILED_RELEASE" == 'true' ]]; then echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT ; fi | |
if [[ "$TILED_RELEASE" != 'true' ]]; then echo "version=$(date "+%Y.%m.%d")" >> $GITHUB_OUTPUT ; fi | |
echo "release=${TILED_RELEASE}" >> $GITHUB_OUTPUT | |
windows: | |
name: Windows (${{ matrix.arch }}-bit, Qt ${{ matrix.qt_version_major }}) | |
runs-on: windows-2019 | |
needs: version | |
strategy: | |
matrix: | |
include: | |
- qt_version: 6.5.2 | |
qt_version_major: 6 | |
qt_toolchain: win64_msvc2019_64 | |
arch: 64 | |
openssl_arch: x64 | |
msvc_path: /c/Qt/Tools/msvc2019_64/bin | |
env: | |
TILED_VERSION: ${{ needs.version.outputs.version }} | |
MSVC_PATH: ${{ matrix.msvc_path }} | |
OPENSSL_VERSION: 1.1.1 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Qt | |
run: | | |
echo "2019" | |
ls "/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/bin" | |
echo "QT_PATH=$(./dist/install-qt.sh --version ${{ matrix.qt_version }} --toolchain ${{ matrix.qt_toolchain }} qtbase qtdeclarative qtsvg qtimageformats qttools qttranslations)" >> $GITHUB_ENV | |
choco install visualstudio2022buildtools | |
echo "OPENSSL_PATH=$(./dist/install-qt.sh --version ${OPENSSL_VERSION} openssl --arch ${{ matrix.openssl_arch }})" >> $GITHUB_ENV | |
- name: Install Qbs | |
run: | | |
choco install -y qbs --version ${QBS_VERSION} | |
- name: Setup Qbs | |
run: | | |
qbs setup-toolchains --detect | |
qbs setup-qt ${QT_PATH}/qmake.exe qt | |
qbs config defaultProfile qt | |
- name: Build Zstandard | |
run: | | |
export PATH="/c/Program Files\ (x86)/Microsoft\ Visual\ Studio/2019/Enterprise/MSBuild/Current/bin:/c/Program\ Files\ (x86)/Microsoft\ Visual\ Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64:$PATH" | |
choco install make | |
choco install cmake | |
git clone --depth 1 -b release https://github.com/facebook/zstd.git | |
pushd zstd/build/cmake | |
mkdir builddir | |
cd builddir | |
cmake .. | |
msbuild zstd.sln | |
popd | |
- name: Build Tiled | |
run: | | |
export TILED_MSI_VERSION=1.4.${GITHUB_RUN_NUMBER} | |
qbs build config:rebug projects.Tiled.windowsInstaller:true projects.Tiled.staticZstd:true | |
mv release/installer*/Tiled-*.msi . | |
- name: Upload Tiled installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-win${{ matrix.arch }}.msi | |
path: Tiled-*.msi | |
- name: Upload Tiled archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-win${{ matrix.arch }} | |
path: release/install-root/* | |
github: | |
name: Upload to GitHub releases | |
runs-on: ubuntu-latest | |
needs: [version, windows] | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Tiled ${{ needs.version.outputs.version }} | |
draft: true | |
prerelease: false | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Upload Windows 64-bit installer | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: Tiled-win64.msi/Tiled-${{ needs.version.outputs.version }}-win64.msi | |
asset_name: Tiled-${{ needs.version.outputs.version }}_Windows-10+_x86_64.msi | |
asset_content_type: application/x-msi | |
- name: Upload Windows 32-bit installer | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: Tiled-win32.msi/Tiled-${{ needs.version.outputs.version }}-win32.msi | |
asset_name: Tiled-${{ needs.version.outputs.version }}_Windows-7-8_x86.msi | |
asset_content_type: application/x-msi |