diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 78d476951..976034dad 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -14,8 +14,6 @@ on: branches: develop pull_request: branches: develop - paths: - - '**appimage.yml' jobs: build-mg-appimage: @@ -54,9 +52,24 @@ jobs: PLATFORM=$(uname -m) echo "ARTIFACT_NAME=AppImages-${PLATFORM//\//-}" >> $GITHUB_ENV - - name: Upload AppImage + - if: ${{ github.ref != 'refs/heads/develop' }} + name: Upload AppImage uses: actions/upload-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: ./*AppImage* if-no-files-found: error + + - if: ${{ github.ref == 'refs/heads/develop' }} + name: 'Prerelease' + uses: ncipollo/release-action@v1 + with: + artifacts: "./*AppImage*" + body: "MegaGlest Snapshot Release" + allowUpdates: true + prerelease: true + removeArtifacts: false + replacesArtifacts: true + omitBodyDuringUpdate: true + omitNameDuringUpdate: true + tag: snapshot diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b987573c9..474975a66 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -8,14 +8,9 @@ on: branches: [ develop ] pull_request: branches: [ develop ] - workflow_run: - workflows: [Docker Image] - types: [completed] - branches: [develop] jobs: build-linux: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} strategy: fail-fast: false matrix: @@ -51,7 +46,6 @@ jobs: # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} strategy: fail-fast: false matrix: @@ -121,27 +115,18 @@ jobs: $7zPath = $(Get-Command 7z).Source cp $7zPath . Remove-Item glest-dev.ini - Compress-Archive -Path *.exe,*.ini -DestinationPath megaglest-$env:VERSION-x64-windows.zip + Compress-Archive -Path *.exe,*.ini -DestinationPath megaglest-x64-windows.zip cd ../.. - name: Create MegaGlest Snapshot if: ${{ github.ref == 'refs/heads/develop' }} uses: actions/upload-artifact@v4 with: - name: megaglest-x64-windows + name: megaglest-x64-windows-archive retention-days: 1 path: mk/windoze/*.zip - on-dockerbuild-failure: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - run: | - echo 'The triggering workflow failed' - exit 1 - build-macos: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} strategy: fail-fast: false runs-on: macos-latest @@ -168,7 +153,7 @@ jobs: cd mk/macos ./make-binary-archive.sh cd - - mv release/mg-binary-macos*.tar.bz2 release/megaglest-$VERSION-x64-macos.tar.bz2 + mv release/mg-binary-macos*.tar.bz2 release/megaglest-x64-macos.tar.bz2 - name: Create MegaGlest Snapshot if: ${{ github.ref == 'refs/heads/develop' }} @@ -177,3 +162,4 @@ jobs: name: megaglest-x64-macos retention-days: 1 path: release/*.tar.bz2 + diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 975f17c23..000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Docker Image - -on: - push: - branches: - - 'master' - - 'develop' - paths: - - '.github/workflows/docker.yml' - - 'mk/linux/Dockerfile' - schedule: - - cron: '0 0 1 * *' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: mk/linux/Dockerfile - push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/megaglest-build-env:bionic - cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/megaglest-build-env:buildcache - cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/megaglest-build-env:buildcache,mode=max diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index fa3c59de8..000000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Pre-release - -on: - workflow_run: - workflows: [Make Snapshot] - types: [completed] - branches: [develop] -jobs: - - release: - runs-on: ubuntu-latest - permissions: - contents: write - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: 'Download artifact' - uses: actions/github-script@v7 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "megaglest-x64-windows" - })[0]; - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-windows.zip`, Buffer.from(download.data)); - - matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "megaglest-x64-ubuntu" - })[0]; - download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-ubuntu.zip`, Buffer.from(download.data)); - - matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "megaglest-x64-macos" - })[0]; - download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-macos.zip`, Buffer.from(download.data)); - - - name: 'Prepare artifacts' - run: | - unzip megaglest-x64-ubuntu.zip - unzip megaglest-x64-windows.zip - unzip megaglest-x64-macos.zip - rm megaglest-x64-windows.zip megaglest-x64-ubuntu.zip megaglest-x64-macos.zip - - name: 'Prerelease' - uses: ncipollo/release-action@v1 - with: - artifacts: "*.tar.xz,*.zip,*.tar.bz2" - body: "MegaGlest Snapshot Release" - allowUpdates: true - prerelease: true - removeArtifacts: true - replacesArtifacts: true - omitBodyDuringUpdate: true - omitNameDuringUpdate: True - tag: snapshot - - on-failure: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - run: | - echo 'The triggering workflow failed' - exit 1 diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 1876c41cb..0989be9a5 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -10,38 +10,7 @@ on: # The artifact only runs on the same distro that it was built on. jobs: - appimage-snapshot: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - container: megaglest/megaglest-build-env:bionic - steps: - - uses: actions/checkout@v4 - - - name: Git Hash - run: | - # Required because docker user is root. - git config --global safe.directory $GITHUB_WORKSPACE - echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - - name: Build - run: mk/linux/build-appimage.sh - - - name: Pack - run: | - cd mk/linux/ - mv g2xml g2xml-$VERSION - mv xml2g xml2g-$VERSION - tar cfJ megaglest-$VERSION-x64-appimage.tar.xz *.AppImage g2xml-* xml2g-* - - - name: Create MegaGlest Snapshot - uses: actions/upload-artifact@v4 - with: - name: megaglest-x64-ubuntu - retention-days: 1 - path: | - mk/linux/*.tar.xz - - transfer-macos-snapshot: + release: runs-on: ubuntu-latest permissions: contents: write @@ -67,55 +36,37 @@ jobs: }); let fs = require('fs'); fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-macos.zip`, Buffer.from(download.data)); - - name: 'Prepare artifacts' - run: | - unzip megaglest-x64-macos.zip - rm megaglest-x64-macos.zip - - name: Create MegaGlest MacOS Snapshot - uses: actions/upload-artifact@v4 - with: - name: megaglest-x64-macos - retention-days: 1 - path: | - *.tar.bz2 - transfer-windows-snapshot: - runs-on: ubuntu-latest - permissions: - contents: write - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: 'Download artifact' - uses: actions/github-script@v7 - with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "megaglest-x64-windows" + matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "megaglest-x64-windows-archive" })[0]; - let download = await github.rest.actions.downloadArtifact({ + download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: matchArtifact.id, archive_format: 'zip', }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-windows.zip`, Buffer.from(download.data)); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-windows-archive.zip`, Buffer.from(download.data)); + - name: 'Prepare artifacts' run: | - unzip megaglest-x64-windows.zip - rm megaglest-x64-windows.zip - - name: Create MegaGlest Windows Snapshot - uses: actions/upload-artifact@v4 + unzip megaglest-x64-windows-archive.zip + unzip megaglest-x64-macos.zip + rm megaglest-x64-windows-archive.zip megaglest-x64-macos.zip + + - name: 'Prerelease' + uses: ncipollo/release-action@v1 with: - name: megaglest-x64-windows - retention-days: 1 - path: | - *.zip + artifacts: "*.zip,*.tar.bz2" + body: "MegaGlest Snapshot Release" + allowUpdates: true + prerelease: true + removeArtifacts: false + replacesArtifacts: true + omitBodyDuringUpdate: true + omitNameDuringUpdate: true + tag: snapshot + on-failure: runs-on: ubuntu-latest diff --git a/CMakeLists.txt b/CMakeLists.txt index 7006742ec..5970bbf4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,6 +208,7 @@ include(CheckCCompilerFlag) # Define your extra flags in a list set(EXTRA_FLAGS + # https://github.com/MegaGlest/megaglest-source/issues/275 "-Werror=odr" "-Werror=lto-type-mismatch" "-Werror=strict-aliasing" diff --git a/mk/linux/Dockerfile b/mk/linux/Dockerfile deleted file mode 100644 index 120a269ce..000000000 --- a/mk/linux/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -# Dockerfile for building mg appimage -FROM ubuntu:bionic - -RUN apt update \ - && apt install -y software-properties-common \ - && add-apt-repository ppa:git-core/ppa \ - && apt update && apt -y upgrade \ - && apt install -y \ - build-essential \ - cmake \ - git \ - imagemagick \ - libbrotli-dev \ - libcppunit-dev \ - libcurl4-gnutls-dev \ - libfreetype6-dev \ - libfribidi-dev \ - libftgl-dev \ - libgl1-mesa-dev \ - libglew-dev \ - libglu1-mesa-dev \ - libgnutls28-dev \ - libidn2-dev \ - libircclient-dev \ - libjpeg-dev \ - libkrb5-dev \ - libldap2-dev \ - liblua5.3-dev \ - libminiupnpc-dev \ - libnghttp2-dev \ - libogg-dev \ - libopenal-dev \ - libpng-dev \ - libpsl-dev \ - librtmp-dev \ - libsdl2-dev \ - libssh-dev \ - libvorbis-dev \ - libwxgtk3.0-gtk3-dev \ - libx11-dev \ - libxml2-dev \ - p7zip-full \ - wget \ - && rm -rf /var/lib/apt/lists - -# Install linuxdeploy -ENV TOOLS_DIR="/tools" -RUN mkdir -p $TOOLS_DIR -ARG ARCH=x86_64 -RUN /bin/bash -c 'cd $TOOLS_DIR \ - && wget https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-${ARCH}.AppImage \ - && chmod +x linuxdeploy-${ARCH}.AppImage \ - && ./linuxdeploy-${ARCH}.AppImage --appimage-extract \ - && rm ./linuxdeploy-${ARCH}.AppImage \ - && wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" \ - && chmod +x linuxdeploy-plugin-gtk.sh \ - && cd -'