diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 2ce6e1b..5ec1328 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -8,7 +8,7 @@ on: description: 'The output of the complete_version of the "determine_version" job from the build_and_release.yml workflow' required: true type: string - release_upload_url: + release_id: description: 'The output of the "create_release" job from the build_and_release.yml workflow' required: true type: string @@ -42,7 +42,7 @@ jobs: sed -i s/@@VERSION@@/${PACKAGE_VERSION}/ AppImageBuilder.yml mkdir build cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_WEBSERVER=ON -DENABLE_WEBCAM=ON -DPERFORMOUS_VERSION=$PACKAGE_VERSION .. + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCOMPOSER_VERSION=$PACKAGE_VERSION .. make -j$(nproc) install DESTDIR=../AppDir cd .. appimage-builder --recipe AppImageBuilder.yml --skip-test @@ -70,11 +70,9 @@ jobs: - name: Upload artifacts to tagged release id: upload_assets if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} - uses: actions/upload-release-asset@v1 + uses: xresloader/upload-to-github-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ inputs.release_upload_url }} - asset_path: ${{ env.ARTIFACT_PATH }} - asset_name: ${{ env.ARTIFACT_NAME }} - asset_content_type: application/octet-stream + release_id: ${{ inputs.release_id }} + file: ${{ env.ARTIFACT_PATH }} diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 8c06775..a18265e 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -38,13 +38,19 @@ jobs: version_tweak: ${{ steps.versioning.outputs.version_tweak }} complete_version: ${{ steps.versioning.outputs.complete_version }} steps: + - name: Checkout Composer + uses: actions/checkout@v3 + with: + path: ${{ github.workspace }}/composer + repository: ${{ github.event.repository.full_name }} + ref: '${{ github.event.head.ref }}' + fetch-depth: 0 - name: Determine the complete version id: versioning run: | # Always check the tags on master since it will have the latest. # Tags will trigger their own workflow and version names - git clone --recursive ${{ github.server_url }}/${{ github.repository }} performous_composer - cd performous_composer + cd composer LATEST_TAG_VERSION=$(git describe --tags --abbrev=0 || echo 1.0.0) LATEST_FULL_TAG_VERSION=$(git describe --tags || echo 1.0.0) echo "latest_tag_version=$(git describe --tags --abbrev=0 || echo 1.0.0)" >> $GITHUB_OUTPUT @@ -53,7 +59,7 @@ jobs: echo "version_minor=$(cut -d '.' -f 2 <<< $(git describe --tags --abbrev=0 || echo 1.0.0))" >> $GITHUB_OUTPUT echo "version_patch=$(cut -d '.' -f 3 <<< $(git describe --tags --abbrev=0 || echo 1.0.0))" >> $GITHUB_OUTPUT echo "version_tweak=0" >> $GITHUB_OUTPUT - echo "complete_version=$(if [ $GITHUB_REF_TYPE = 'tag' ]; then echo $GITHUB_REF_NAME; elif [ $GITHUB_REF_TYPE = 'branch' ] && [ $GITHUB_REF_NAME = 'master' ]; then echo $LATEST_FULL_TAG_VERSION-beta; elif [ $GITHUB_REF_TYPE = 'branch' ] && [ $GITHUB_REF_NAME != 'master' ]; then echo $LATEST_TAG_VERSION-${{github.event.pull_request.number}}-${GITHUB_SHA::7}-alpha; fi)" >> $GITHUB_OUTPUT + echo "complete_version=$(if [ $GITHUB_REF_TYPE = 'tag' ]; then echo $GITHUB_REF_NAME; elif [ $GITHUB_REF_TYPE = 'branch' ] && [ $GITHUB_REF_NAME = 'master' ]; then echo $LATEST_FULL_TAG_VERSION-beta; elif [ $GITHUB_REF_TYPE = 'branch' ] && [ $GITHUB_REF_NAME != 'master' ]; then echo $LATEST_TAG_VERSION-${{github.event.pull_request.number}}-$(git rev-parse --short=7 $(git describe))-alpha; fi)" >> $GITHUB_OUTPUT # Set up a release that packages will be published to. create_release: @@ -62,17 +68,15 @@ jobs: # Make sure the output variable for this step is set so it # can be consumed by later build steps outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} + release_id: ${{ steps.create_release.outputs.id }} steps: - name: Create the Main release id: create_release if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.ref_name }} - release_name: Composer ${{ github.ref_name }} + name: Composer ${{ github.ref_name }} draft: true prerelease: false @@ -82,18 +86,18 @@ jobs: uses: ./.github/workflows/linux.yml with: package_complete_version: ${{ needs.determine_version.outputs.complete_version }} - release_upload_url: ${{ needs.create_release.outputs.upload_url }} + release_id: ${{ needs.create_release.outputs.release_id }} needs: - determine_version - create_release # Pull in the AppImage build workflow AppImage_Package: - name: Build the AppImage + name: Build the AppImage package uses: ./.github/workflows/appimage.yml with: package_complete_version: ${{ needs.determine_version.outputs.complete_version }} - release_upload_url: ${{ needs.create_release.outputs.upload_url }} + release_id: ${{ needs.create_release.outputs.release_id }} needs: - determine_version - create_release @@ -110,12 +114,12 @@ jobs: # - create_release # Pull in the Windows build workflow - #Windows_Packages: - # name: Build the Windows packages - # uses: ./.github/workflows/windows.yml - # with: - # package_complete_version: ${{ needs.determine_version.outputs.complete_version }} - # release_upload_url: ${{ needs.create_release.outputs.upload_url }} - # needs: - # - determine_version - # - create_release + Windows_Packages: + name: Build the Windows packages + uses: ./.github/workflows/windows.yml + with: + package_complete_version: ${{ needs.determine_version.outputs.complete_version }} + release_id: ${{ needs.create_release.outputs.release_id }} + needs: + - determine_version + - create_release diff --git a/.github/workflows/build_functions.sh b/.github/workflows/build_functions.sh index bf51e9c..b173f8e 100644 --- a/.github/workflows/build_functions.sh +++ b/.github/workflows/build_functions.sh @@ -26,31 +26,31 @@ ## The fourth argument is the OS name, and the fifth ## argument is the OS version, both are optional. function package_name () { - WORK_DIR=${1} - PACKAGE_REGEX=${2} - PACKAGE_OFFICIAL_VERSION=${3} - PACKAGE_OS=${4} - PACKAGE_OS_VERSION=${5} + WORK_DIR=${1} + PACKAGE_REGEX=${2} + PACKAGE_OFFICIAL_VERSION=${3} + PACKAGE_OS=${4} + PACKAGE_OS_VERSION=${5} - if [ ${PACKAGE_OS} ]; then - PACKAGE_OS_NAME="-${PACKAGE_OS}" - fi - if [ ${PACKAGE_OS_VERSION} ]; then - PACKAGE_OS_VERSION_NAME="_${PACKAGE_OS_VERSION}" - fi - PACKAGE_PATH=$(ls ${WORK_DIR}/${PACKAGE_REGEX}) - PACKAGE_NAME=$(basename ${PACKAGE_PATH}) - PACKAGE_SUFFIX=$(echo ${PACKAGE_NAME} | rev | cut -d'.' -f1 | rev) - NEW_PACKAGE_NAME="Composer-${PACKAGE_OFFICIAL_VERSION}${PACKAGE_OS_NAME}${PACKAGE_OS_VERSION_NAME}.${PACKAGE_SUFFIX}" - NEW_PACKAGE_PATH="/tmp/${NEW_PACKAGE_NAME}" - MASTER_NEW_PACKAGE_NAME="Composer-latest${PACKAGE_OS_NAME}${PACKAGE_OS_VERSION_NAME}.${PACKAGE_SUFFIX}" - MASTER_NEW_PACKAGE_PATH="/tmp/${MASTER_NEW_PACKAGE_NAME}" - cp ${PACKAGE_PATH} ${MASTER_NEW_PACKAGE_PATH} - cp ${PACKAGE_PATH} ${NEW_PACKAGE_PATH} - ARTIFACT_NAME=$(basename ${NEW_PACKAGE_NAME}) - MASTER_ARTIFACT_NAME=$(basename ${MASTER_NEW_PACKAGE_NAME}) - echo "ARTIFACT_PATH=${NEW_PACKAGE_PATH}" >> ${GITHUB_ENV} - echo "ARTIFACT_NAME=${NEW_PACKAGE_NAME}" >> ${GITHUB_ENV} - echo "MASTER_ARTIFACT_PATH=${MASTER_NEW_PACKAGE_PATH}" >> ${GITHUB_ENV} - echo "MASTER_ARTIFACT_NAME=${MASTER_NEW_PACKAGE_NAME}" >> ${GITHUB_ENV} + if [[ "${PACKAGE_OS}" != "" ]]; then + PACKAGE_OS_NAME="-${PACKAGE_OS}" + fi + if [[ "${PACKAGE_OS_VERSION}" != "" ]]; then + PACKAGE_OS_VERSION_NAME="_${PACKAGE_OS_VERSION}" + fi + PACKAGE_PATH=$(ls ${WORK_DIR}/${PACKAGE_REGEX}) + PACKAGE_NAME=$(basename ${PACKAGE_PATH}) + PACKAGE_SUFFIX=$(echo ${PACKAGE_NAME} | rev | cut -d'.' -f1 | rev) + NEW_PACKAGE_NAME="Performous-${PACKAGE_OFFICIAL_VERSION}${PACKAGE_OS_NAME}${PACKAGE_OS_VERSION_NAME}.${PACKAGE_SUFFIX}" + NEW_PACKAGE_PATH="/tmp/${NEW_PACKAGE_NAME}" + MASTER_NEW_PACKAGE_NAME="Performous-latest${PACKAGE_OS_NAME}${PACKAGE_OS_VERSION_NAME}.${PACKAGE_SUFFIX}" + MASTER_NEW_PACKAGE_PATH="/tmp/${MASTER_NEW_PACKAGE_NAME}" + cp ${PACKAGE_PATH} ${MASTER_NEW_PACKAGE_PATH} + cp ${PACKAGE_PATH} ${NEW_PACKAGE_PATH} + ARTIFACT_NAME=$(basename ${NEW_PACKAGE_NAME}) + MASTER_ARTIFACT_NAME=$(basename ${MASTER_NEW_PACKAGE_NAME}) + echo "ARTIFACT_PATH=${NEW_PACKAGE_PATH}" >> ${GITHUB_ENV} + echo "ARTIFACT_NAME=${NEW_PACKAGE_NAME}" >> ${GITHUB_ENV} + echo "MASTER_ARTIFACT_PATH=${MASTER_NEW_PACKAGE_PATH}" >> ${GITHUB_ENV} + echo "MASTER_ARTIFACT_NAME=${MASTER_NEW_PACKAGE_NAME}" >> ${GITHUB_ENV} } diff --git a/.github/workflows/comment_on_pr.yml b/.github/workflows/comment_on_pr.yml index 42bbb40..7d99c58 100644 --- a/.github/workflows/comment_on_pr.yml +++ b/.github/workflows/comment_on_pr.yml @@ -14,13 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Get the PR number + id: get_pr run: | # Query the issue search API to get the PR associated with it PR_RAW=$(curl 'https://api.github.com/search/issues?q=${{ github.event.workflow_run.head_commit.id }}') # Get the event number from the search results, which will # be the PR number PR_NUM=$(echo $PR_RAW | jq '.items[].number') - echo "PR_NUM=${PR_NUM}" >> ${GITHUB_ENV} + echo "PR_NUM=${PR_NUM}" >> $GITHUB_OUTPUT - name: Comment on PR uses: actions/github-script@v5 @@ -61,5 +62,5 @@ jobs: } body += ` \n\nThis service is provided by [nightly.link](https://github.com/oprypin/nightly.link). These artifacts will expire in 90 days and will not be available for download after that time.`; core.info("Review thread message body:", body); - await upsertComment(owner, repo, ${{ env.PR_NUM }}, + await upsertComment(owner, repo, ${{ steps.get_pr.outputs.PR_NUM }}, "nightly-link", body); diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6383675..92f4c9b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,7 +8,7 @@ on: description: 'The output of the complete_version of the "determine_version" job from the build_and_release.yml workflow' required: true type: string - release_upload_url: + release_id: description: 'The output of the "create_release" job from the build_and_release.yml workflow' required: true type: string @@ -19,11 +19,14 @@ env: jobs: # Decide if we need to build the containers on this run - determine_docker_build: + determine_docker_version: name: Determine whether to build the containers or not runs-on: ubuntu-latest outputs: - build_docker_containers: ${{ steps.docker_check.outputs.build_docker_containers }} + build_docker_containers: ${{ steps.version.outputs.build_docker_containers }} + build_debian_containers: ${{ steps.version.outputs.build_debian_containers }} + build_ubuntu_containers: ${{ steps.version.outputs.build_ubuntu_containers }} + build_fedora_containers: ${{ steps.version.outputs.build_fedora_containers }} steps: - name: Checkout id: checkout @@ -31,23 +34,58 @@ jobs: with: fetch-depth: 0 - - name: Build docker check - id: docker_check + - name: Determine version + id: version run: | # Only run the container builds when something in the docker folder or # this workflow has changed from master, or if it was cron triggered - GIT_OUTPUT="$(git log -n 2 --stat)" - if [ $(echo ${GIT_OUTPUT} | grep -c docker/) -gt 0 ] || [ $(echo ${GIT_OUTPUT} | grep -c .github/workflows/linux.yml) -gt 0 ] || [ '${{ github.event_name }}' = 'schedule' ]; then + if [[ '${{ github.event_name }}' == 'push' ]]; then + base_version='${{ github.event.before }}' + else + base_version='origin/master' + fi + DIFF_YML=$((git rev-parse HEAD:.github/workflows/linux.yml && git diff --merge-base ${base_version} --exit-code -- .github/workflows/linux.yml) > /dev/null 2>&1 ; echo $?) + if [[ $DIFF_YML != 0 || '${{ github.event_name }}' == 'schedule' ]]; then + echo "Refresh all containers: TRUE" echo "build_docker_containers=true" >> $GITHUB_OUTPUT else + echo "Refresh all containers: FALSE" echo "build_docker_containers=false" >> $GITHUB_OUTPUT fi + DIFF_UBUNTU=$((git rev-parse HEAD:docker/Dockerfile.ubuntu HEAD:docker/build_performous.sh && git diff --merge-base ${base_version} --exit-code -- docker/Dockerfile.ubuntu docker/build_performous.sh) > /dev/null 2>&1 ; echo $?) + DIFF_DEBIAN=$((git rev-parse HEAD:docker/Dockerfile.debian HEAD:docker/build_performous.sh && git diff --merge-base ${base_version} --exit-code -- docker/Dockerfile.debian docker/build_performous.sh) > /dev/null 2>&1 ; echo $?) + DIFF_FEDORA=$((git rev-parse HEAD:docker/Dockerfile.fedora HEAD:docker/build_performous.sh && git diff --merge-base ${base_version} --exit-code -- docker/Dockerfile.fedora docker/build_performous.sh) > /dev/null 2>&1 ; echo $?) + + if [[ $DIFF_UBUNTU != 0 ]]; then + echo "Refresh Ubuntu containers: TRUE" + echo "build_ubuntu_containers=true" >> $GITHUB_OUTPUT + else + echo "Refresh Ubuntu containers: FALSE" + echo "build_ubuntu_containers=false" >> $GITHUB_OUTPUT + fi + + if [[ $DIFF_FEDORA != 0 ]]; then + echo "Refresh FEDORA containers: TRUE" + echo "build_fedora_containers=true" >> $GITHUB_OUTPUT + else + echo "Refresh FEDORA containers: FALSE" + echo "build_fedora_containers=false" >> $GITHUB_OUTPUT + fi + + if [[ $DIFF_DEBIAN != 0 ]]; then + echo "Refresh DEBIAN containers: TRUE" + echo "build_debian_containers=true" >> $GITHUB_OUTPUT + else + echo "Refresh DEBIAN containers: FALSE" + echo "build_debian_containers=false" >> $GITHUB_OUTPUT + fi + build_packages: name: Build the Linux packages runs-on: ubuntu-latest needs: - - determine_docker_build + - determine_docker_version strategy: matrix: include: @@ -59,19 +97,25 @@ jobs: version: 10 - os: debian version: 11 - - os: fedora - version: 34 + - os: debian + version: 12 - os: fedora version: 35 ## FFMPEG5 causes issues ## See https://github.com/performous/composer/issues/45 - #- os: fedora - # version: 36 + - os: fedora + version: 36 + - os: fedora + version: 37 + - os: fedora + version: 38 + - os: fedora + version: 39 steps: - name: Container name run: | # Figure out the container name we'll use for the build - BUILD_CONTAINER=${{ env.REGISTRY }}/${{ env.REPO_NAME }}/composer-deps:${{ matrix.os }}-${{ matrix.version }} + BUILD_CONTAINER=${{ env.REGISTRY }}/${{ env.REPO_NAME }}/deps:${{ matrix.os }}-${{ matrix.version }} echo "CONTAINER_NAME=${BUILD_CONTAINER}" >> $GITHUB_ENV - name: Checkout @@ -85,7 +129,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build ${{ matrix.os }} ${{ matrix.version }} Container - if: ${{ needs.determine_docker_build.outputs.build_docker_containers == 'true' }} + if: needs.determine_docker_version.outputs[format('build_{0}_containers', matrix.os)] == 'true' || needs.determine_docker_version.outputs['build_docker_containers'] == 'true' uses: docker/build-push-action@v3 with: context: docker/ @@ -102,25 +146,19 @@ jobs: # Set the correct version in cmake PACKAGE_VERSION=${{ inputs.package_complete_version }} EXTRA_CMAKE_ARGS="-DCOMPOSER_VERSION=${PACKAGE_VERSION}" - - # Decide if we should build a 'Release' package or a 'RelWithDebInfo' (default) - # For some reason, building with 'RelWithDebInfo' (default) doesn't work - # specifically on PRs, so we'll just build Releases for everything for now - #if [ '${{ github.event_name }}' != 'pull_request' ]; then - RELEASE_TYPE="-R" - #fi + COMPOSER_RELEASE_TYPE="RelWithDebInfo" # Only pull the container if it wasn't built locally - if [ '${{ needs.determine_docker_build.outputs.build_docker_containers }}' = 'false' ]; then + if [ '${{ needs.determine_docker_version.outputs.build_docker_containers }}' = 'false' ]; then docker pull ${{ env.CONTAINER_NAME }} fi # Run the build inside the docker containers using the # build script that was pulled inside during the build - docker run --rm -v $(pwd):/github_actions_build/ ${{ env.CONTAINER_NAME }} ./build_composer.sh -g -D /github_actions_build/ -E ${EXTRA_CMAKE_ARGS} ${RELEASE_TYPE} + docker run --env EXTRA_CMAKE_ARGS --rm -v $(pwd):/github_actions_build/ ${{ env.CONTAINER_NAME }} ./build_composer.sh -g -D /github_actions_build/ -E ${EXTRA_CMAKE_ARGS} -R ${COMPOSER_RELEASE_TYPE} ## Provided by the common build functions - package_name "$(pwd)/build" "Composer*64.*" "${PACKAGE_VERSION}" "${{ matrix.os }}" "${{ matrix.version }}" + package_name "$(pwd)/build" "Composer*Linux.*" "${PACKAGE_VERSION}" "${{ matrix.os }}" "${{ matrix.version }}" #- name: Run unit tests # run: | @@ -147,20 +185,18 @@ jobs: - name: Upload artifacts to tagged release id: upload_assets if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} - uses: actions/upload-release-asset@v1 + uses: xresloader/upload-to-github-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ inputs.release_upload_url }} - asset_path: ${{ env.ARTIFACT_PATH }} - asset_name: ${{ env.ARTIFACT_NAME }} - asset_content_type: application/octet-stream + release_id: ${{ inputs.release_id }} + file: ${{ env.ARTIFACT_PATH }} - name: Push container uses: docker/build-push-action@v3 # Containers can't be pushed during PRs because of the way permissions # are delegated to secrets.GITHUB_TOKEN - if: ${{ needs.determine_docker_build.outputs.build_docker_containers == 'true' && github.event_name != 'pull_request' }} + if: ${{ needs.determine_docker_version.outputs.build_docker_containers == 'true' && github.event_name != 'pull_request' }} with: context: docker/ file: ./docker/Dockerfile.${{ matrix.os }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..ef20bd0 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,195 @@ +name: Build Windows Packages + +on: + # Run when called from other workflows + workflow_call: + inputs: + package_complete_version: + description: 'The output of the complete_version of the "determine_version" job from the build_and_release.yml workflow' + required: true + type: string + release_id: + description: 'The output of the "create_release" job from the build_and_release.yml workflow' + required: true + type: string + +jobs: + # Create the Windows installer + Windows_MSVC_Packages: + name: Create Windows installer with MSVC + runs-on: windows-latest + defaults: + run: + shell: powershell + steps: + - name: Checkout Git + id: checkout_git + uses: actions/checkout@v3 + with: + path: composer + + + - name: Setup our dev environment + uses: ilammy/msvc-dev-cmd@v1 + + - name: Setup ninja cmake generator + uses: abdes/gha-setup-ninja@master + + - name: Download and build our dependencies using vcpkg + uses: Lord-Kamina/vcpkg-action@update_cache + with: + pkgs: "\"qt5-base\" \"qt5-multimedia\" \"ffmpeg[avcodec,avformat,core,swresample,swscale]\" \"gettext[core]\" \"gperf[core]\" \"gtest[core]\"" + triplet: x64-windows-release + extra-args: '--clean-after-build --overlay-triplets="${{ github.workspace }}\composer\cmake\triplets"' + cache-key: win64-vcpkg + revision: 9d47b24eacbd1cd94f139457ef6cd35e5d92cc84 + api-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run cmake to configure the project and build it + env: + COMPOSER_VERSION: ${{ inputs.package_complete_version }} + run: | + set VCPKG_BINARY_SOURCES="files,${{ github.workspace }}\vcpkg_cache,read" + cd ${{ github.workspace }}/composer + echo $COMPOSER_VERSION + cmake --preset "x64-debinfo" -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_OVERLAY_TRIPLETS="${{ github.workspace }}\composer\cmake\triplets" + cmake --build --preset "x64-debinfo" + #- name: Run unittests directly called. + # run: | + # cd "composer/build/x64-debinfo/testing" + # ./composer_test.exe --gtest_filter=UnitTest* + #- name: Run unittests by ctest. + # run: | + # cd "composer/build/x64-debinfo" + # ninja testing/test + - name: Create Installer + id: package_composer_x64 + run: | + cd composer/build/x64-debinfo + cpack -G NSIS64 x64-debinfo + Copy-Item $(Get-ChildItem -Filter '*win64.exe').Name "Composer-latest-msvc.exe" + Rename-Item $(Get-ChildItem -Filter '*win64.exe').Name -NewName "Composer-${{ inputs.package_complete_version }}-msvc.exe" + chcp 65001 #set code page to utf-8 + echo ("ARTIFACT_PATH=${{ github.workspace }}/composer/build/x64-debinfo/Composer-${{ inputs.package_complete_version }}-msvc.exe") >> $env:GITHUB_ENV + echo ("ARTIFACT_FILENAME=Composer-${{ inputs.package_complete_version }}-msvc.exe") >> $env:GITHUB_ENV + echo ("MASTER_ARTIFACT_PATH=${{ github.workspace }}/composer/build/x64-debinfo/Composer-latest-msvc.exe") >> $env:GITHUB_ENV + echo ("MASTER_ARTIFACT_FILENAME=Composer-latest-msvc.exe") >> $env:GITHUB_ENV + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + name: ${{ env.ARTIFACT_FILENAME }} + path: ${{ env.ARTIFACT_PATH }} + + - name: Upload artifact with unified name + if: ${{ github.ref == 'refs/heads/master' }} + uses: actions/upload-artifact@v3 + with: + name: ${{ env.MASTER_ARTIFACT_FILENAME }} + path: ${{ env.MASTER_ARTIFACT_PATH }} + + - name: Upload artifacts to tagged release + id: upload_assets + if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ inputs.release_id }} + file: ${{ env.ARTIFACT_PATH }} + + Windows_MinGW-w64_Packages: + name: Create Windows installer with MinGW-w64 + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - name: Checkout Git + id: checkout_git + uses: actions/checkout@v3 + with: + path: composer + - name: Setup action env and echoing + shell: bash + run: | + echo '::echo::on' + echo 'action_echo=enabled' >> $GITHUB_OUTPUT + echo workpath=$(echo '${{ github.workspace }}' | sed 's|\\|/|g') >> $GITHUB_ENV + - name: Install MSYS2. + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: false + location: "${{ env.workpath }}" + install: >- + git + mingw-w64-x86_64-cc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ffmpeg + mingw-w64-x86_64-gettext + mingw-w64-x86_64-make + mingw-w64-x86_64-nsis + mingw-w64-x86_64-qt5-base + mingw-w64-x86_64-qt5-multimedia + mingw-w64-x86_64-winpthreads-git + + - name: Run cmake to configure the project and build it + env: + COMPOSER_VERSION: ${{ inputs.package_complete_version }} + shell: msys2 {0} + run: | + cd "${{ env.workpath }}/composer" + mkdir build + #for f in $(ls -Q ./lang/*.po); do mkdir -pv "./build/lang/$(basename $f | cut -d. -f1)/LC_MESSAGES";done + cd build + "${{ env.workpath }}/msys64/mingw64/bin/cmake.exe" -G "MinGW Makefiles" .. -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCOMPOSER_VERSION=${{ env.COMPOSER_VERSION }} -DBUILD_TESTS=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON -DCPACK_MINGW_SYSTEM_PREFIX="${{ env.workpath }}/msys64/mingw64" + "${{ env.workpath }}/msys64/mingw64/bin/cmake.exe" --build ./ --verbose --parallel 3 + #- name: Run unittests directly called. + # shell: msys2 {0} + # run: | + # cd "${{ env.workpath }}/composer/build/testing" + # ./composer_test.exe --gtest_filter=UnitTest* + #- name: Run unittests by ctest. + # shell: msys2 {0} + # run: | + # cd "${{ env.workpath }}/composer/build" + # "${{ env.workpath }}/msys64/mingw64/bin/mingw32-make.exe" test + - name: Create Installer + id: package_composer_x64 + shell: msys2 {0} + run: | + cd "${{ env.workpath }}/composer/build" + "${{ env.workpath }}/msys64/mingw64/bin/cpack.exe" -G NSIS64 -DCPACK_MINGW_SYSTEM_PREFIX="${{ env.workpath }}/msys64/mingw64" -DCPACK_NSIS_EXECUTABLE="${{ env.workpath }}/msys64/mingw64/bin/makensis.exe" -DCMAKE_BUILD_TYPE="RelWithDebInfo" --verbose + powershell -command "Copy-Item \$(Get-ChildItem -Filter '*win64.exe').Name 'Composer-latest-mingw-w64.exe'" + powershell -command "Rename-Item \$(Get-ChildItem -Filter '*win64.exe').Name -NewName 'Composer-${{ inputs.package_complete_version }}-mingw-w64.exe'" + powershell -command "echo ('ARTIFACT_PATH=${{ env.workpath }}/composer/build/Composer-${{ inputs.package_complete_version }}-mingw-w64.exe') >> \$env:GITHUB_ENV" + powershell -command "echo ('ARTIFACT_FILENAME=Composer-${{ inputs.package_complete_version }}-mingw-w64.exe') >> \$env:GITHUB_ENV" + powershell -command "echo ('MASTER_ARTIFACT_PATH=${{ env.workpath }}/composer/build/Composer-latest-mingw-w64.exe') >> \$env:GITHUB_ENV" + powershell -command "echo ('MASTER_ARTIFACT_FILENAME=Composer-latest-mingw-w64.exe') >> \$env:GITHUB_ENV" + - name: Upload artifacts + uses: actions/upload-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} + with: + name: ${{ env.ARTIFACT_FILENAME }} + path: ${{ env.ARTIFACT_PATH }} + + - name: Upload artifact with unified name + if: ${{ github.ref == 'refs/heads/master' }} + uses: actions/upload-artifact@v3 + with: + name: ${{ env.MASTER_ARTIFACT_FILENAME }} + path: ${{ env.MASTER_ARTIFACT_PATH }} + + - name: Upload artifacts to tagged release + id: upload_assets + if: ${{ github.event_name != 'pull_request' && github.ref_type == 'tag' }} + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ inputs.release_id }} + file: ${{ env.ARTIFACT_PATH }} diff --git a/README.md b/README.md index 9613cd6..af75df6 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,18 @@ Features Latest builds ========== +- [Windows (MSVC)](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-msvc.exe.zip) +- [Windows (MinGW-w64)](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-mingw-w64.exe.zip) - [Linux - Ubuntu 20.04](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-ubuntu_20.04.deb.zip) - [Linux - Ubuntu 22.04](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-ubuntu_22.04.deb.zip) - [Linux - Debian 10](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-debian_10.deb.zip) - [Linux - Debian 11](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-debian_11.deb.zip) -- [Linux - Fedora 34](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_34.rpm.zip) +- [Linux - Debian 12](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-debian_12.deb.zip) - [Linux - Fedora 35](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_35.rpm.zip) +- [Linux - Fedora 36](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_36.rpm.zip) +- [Linux - Fedora 37](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_37.rpm.zip) +- [Linux - Fedora 38](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_38.rpm.zip) +- [Linux - Fedora 39](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest-fedora_39.rpm.zip) - [Linux - AppImage](https://nightly.link/performous/composer/workflows/build_and_release/master/Composer-latest.AppImage.zip) Build & Install diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index e722102..5a6cb6d 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -5,6 +5,7 @@ FROM docker.io/library/debian:${OS_VERSION} ## Copy OS_VERSION into ENV so we can use it in scripts too ARG OS_VERSION ENV OS_VERSION=${OS_VERSION} +ENV PACKAGE_TYPE="DEB" ## Set up environment variables so the tzdata install doesn't ## hang on asking for user input for configuration diff --git a/docker/Dockerfile.fedora b/docker/Dockerfile.fedora index 8c55a54..c55d250 100644 --- a/docker/Dockerfile.fedora +++ b/docker/Dockerfile.fedora @@ -2,6 +2,9 @@ ARG OS_VERSION ## Use the official Fedora Image from Dockerhub FROM docker.io/library/fedora:${OS_VERSION} +ENV OS_VERSION=${OS_VERSION} +ENV PACKAGE_TYPE="RPM" + ## Install the deps and create the working directory ## Enable the RPM Fusion Free Repo RUN dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm &&\ diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu index f99ff48..9a1052b 100644 --- a/docker/Dockerfile.ubuntu +++ b/docker/Dockerfile.ubuntu @@ -6,6 +6,7 @@ FROM docker.io/library/ubuntu:${OS_VERSION} ## hang on asking for user input for configuration ARG DEBIAN_FRONTEND="noninteractive" ARG TZ="America/New_York" +ENV PACKAGE_TYPE="DEB" ## Install the deps and create the build directory RUN apt-get update && \