Bump Crown v0.66.0 #647
This file contains hidden or 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: dist | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: crown-package-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| detect: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| is_tag: ${{ steps.detect.outputs.is_tag }} | |
| version: ${{ steps.detect.outputs.version }} | |
| branch: ${{ steps.detect.outputs.branch }} | |
| steps: | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: detect | |
| id: detect | |
| run: | | |
| set -euo pipefail | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| echo "is_tag=true" >> $GITHUB_OUTPUT | |
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| echo "branch=" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_tag=false" >> $GITHUB_OUTPUT | |
| if [ -n "${GITHUB_HEAD_REF:-}" ]; then | |
| BRANCH="${GITHUB_HEAD_REF}" | |
| elif [[ "${GITHUB_REF}" == refs/heads/* ]]; then | |
| BRANCH="${GITHUB_REF#refs/heads/}" | |
| else | |
| BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || true)" | |
| if [ -z "${BRANCH:-}" ] || [ "${BRANCH}" = "HEAD" ]; then | |
| BRANCH="$(git name-rev --name-only HEAD 2>/dev/null || true)" | |
| fi | |
| BRANCH="${BRANCH#remotes/origin/}" | |
| fi | |
| echo "branch=${BRANCH}" >> $GITHUB_OUTPUT | |
| echo "version=${BRANCH}" >> $GITHUB_OUTPUT | |
| fi | |
| package-ubuntu: | |
| name: ${{ matrix.target }} | |
| needs: detect | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: android-arm | |
| platform: android | |
| arch: arm | |
| - target: android-arm64 | |
| platform: android | |
| arch: arm64 | |
| - target: html5-wasm | |
| platform: html5 | |
| arch: wasm | |
| - target: linux-x64 | |
| platform: linux | |
| arch: x64 | |
| runs-on: ubuntu-22.04 | |
| env: | |
| IS_TAG: ${{ needs.detect.outputs.is_tag }} | |
| VERSION: ${{ needs.detect.outputs.version }} | |
| BRANCH: ${{ needs.detect.outputs.branch }} | |
| GCC16_ROOT: /opt/gcc-16.2.0 | |
| GCC16_GDRIVE_FILE_ID: 1QsuKc06WHJj6FNuohwyG99L5f5rUww1p | |
| GCC16_SHA256_GDRIVE_FILE_ID: 1mn6bUGPKPcAkhUlrHhieRH89as0Eqa5y | |
| steps: | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: detect | |
| run: | | |
| set -euo pipefail | |
| echo "IS_TAG=${IS_TAG}" >> $GITHUB_ENV | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | |
| - name: install-deps | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| case "${{ matrix.platform }}" in | |
| android) | |
| sudo apt-get update | |
| sudo apt-get install libc6-dev-i386 | |
| ANDROID_SDK_ROOT=/usr/local/lib/android/sdk | |
| SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager | |
| echo "y" | $SDKMANAGER "ndk;23.2.8568313" | |
| ;; | |
| html5) | |
| git clone https://github.com/emscripten-core/emsdk.git "${GITHUB_WORKSPACE}/emsdk" | |
| pushd "${GITHUB_WORKSPACE}/emsdk" | |
| ./emsdk install latest | |
| ./emsdk activate latest | |
| popd | |
| ;; | |
| linux) | |
| sudo add-apt-repository ppa:vala-team -y | |
| sudo apt-get update | |
| sudo apt-get install -y mesa-common-dev libgl1-mesa-dev libpulse-dev libxrandr-dev libdecor-0-dev libc6-dev-i386 libgtk-3-dev gettext python3-sphinx valac libxml2-utils | |
| ;; | |
| esac | |
| - name: install-gcc16 | |
| if: matrix.platform == 'linux' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| GCC16_ARCHIVE="gcc-16.2.0-ubuntu22.04-amd64.tar.xz" | |
| GCC16_SHA256="${GCC16_ARCHIVE}.sha256" | |
| cd "${RUNNER_TEMP}" | |
| curl --fail --location --retry 5 --retry-all-errors \ | |
| "https://drive.usercontent.google.com/download?id=${GCC16_GDRIVE_FILE_ID}&export=download&confirm=t" \ | |
| --output "${GCC16_ARCHIVE}" | |
| curl --fail --location --retry 5 --retry-all-errors \ | |
| "https://drive.usercontent.google.com/download?id=${GCC16_SHA256_GDRIVE_FILE_ID}&export=download&confirm=t" \ | |
| --output "${GCC16_SHA256}" | |
| sha256sum -c "${GCC16_SHA256}" | |
| sudo tar -xJf "${GCC16_ARCHIVE}" -C / | |
| test -x "${GCC16_ROOT}/bin/gcc" | |
| test -x "${GCC16_ROOT}/bin/g++" | |
| test -x /usr/bin/gcc-11 | |
| test -x /usr/bin/g++-11 | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 110 | |
| sudo update-alternatives --install /usr/bin/gcc gcc "${GCC16_ROOT}/bin/gcc" 160 | |
| sudo update-alternatives --install /usr/bin/g++ g++ "${GCC16_ROOT}/bin/g++" 160 | |
| sudo update-alternatives --set gcc "${GCC16_ROOT}/bin/gcc" | |
| sudo update-alternatives --set g++ "${GCC16_ROOT}/bin/g++" | |
| test "$(readlink -f /usr/bin/gcc)" = "${GCC16_ROOT}/bin/gcc" | |
| test "$(readlink -f /usr/bin/g++)" = "${GCC16_ROOT}/bin/g++" | |
| - name: package | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| case "${{ matrix.platform }}" in | |
| android) | |
| export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/23.2.8568313 | |
| export ANDROID_NDK_ABI=23 | |
| ;; | |
| html5) | |
| export EMSCRIPTEN=$GITHUB_WORKSPACE/emsdk/upstream/emscripten | |
| ;; | |
| esac | |
| if [ "$IS_TAG" = "true" ]; then | |
| ./scripts/dist/package.sh ${{ matrix.platform }} ${{ matrix.arch }} --noconfirm | |
| else | |
| ./scripts/dist/package.sh ${{ matrix.platform }} ${{ matrix.arch }} --branch "${BRANCH}" --noconfirm | |
| fi | |
| - name: upload-dist | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-${{ matrix.target }} | |
| path: dist-${{ matrix.target }}.tar.gz | |
| retention-days: 1 | |
| package-windows: | |
| name: ${{ matrix.target }} | |
| needs: detect | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: windows-x64 | |
| arch: x64 | |
| msystem: MINGW64 | |
| - target: windows-x32 | |
| arch: x32 | |
| msystem: MINGW32 | |
| runs-on: windows-latest | |
| env: | |
| IS_TAG: ${{ needs.detect.outputs.is_tag }} | |
| VERSION: ${{ needs.detect.outputs.version }} | |
| BRANCH: ${{ needs.detect.outputs.branch }} | |
| steps: | |
| - name: setup-msys2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: ${{ matrix.msystem }} | |
| update: false | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: detect | |
| shell: msys2 {0} | |
| run: | | |
| set -euo pipefail | |
| echo "IS_TAG=${IS_TAG}" >> $GITHUB_ENV | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | |
| - name: install-deps | |
| shell: msys2 {0} | |
| run: | | |
| set -euo pipefail | |
| case "${{ matrix.arch }}" in | |
| x64) | |
| pacman --noconfirm -S make mingw-w64-x86_64-gcc mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gtk3 mingw-w64-x86_64-vala gettext git mingw-w64-x86_64-python-sphinx | |
| ;; | |
| x32) | |
| pacman --noconfirm -S make mingw-w64-i686-gcc mingw-w64-i686-pkgconf git | |
| ;; | |
| esac | |
| - name: package | |
| shell: msys2 {0} | |
| run: | | |
| set -euo pipefail | |
| if [ "$IS_TAG" = "true" ]; then | |
| ./scripts/dist/package.sh windows ${{ matrix.arch }} --noconfirm | |
| else | |
| ./scripts/dist/package.sh windows ${{ matrix.arch }} --branch "${BRANCH}" --noconfirm | |
| fi | |
| - name: upload-dist | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist-${{ matrix.target }} | |
| path: dist-${{ matrix.target }}.tar.gz | |
| retention-days: 1 | |
| finalize: | |
| outputs: | |
| crown_version: ${{ steps.version.outputs.crown_version }} | |
| commit: ${{ steps.version.outputs.commit }} | |
| revision: ${{ steps.version.outputs.revision }} | |
| gdrive_file_id: ${{ steps.nightly.outputs.gdrive_file_id }} | |
| needs: | |
| - package-ubuntu | |
| - package-windows | |
| - detect | |
| runs-on: ubuntu-22.04 | |
| env: | |
| IS_TAG: ${{ needs.detect.outputs.is_tag }} | |
| VERSION: ${{ needs.detect.outputs.version }} | |
| BRANCH: ${{ needs.detect.outputs.branch }} | |
| steps: | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: detect | |
| run: | | |
| set -euo pipefail | |
| echo "IS_TAG=${IS_TAG}" >> $GITHUB_ENV | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | |
| - name: download-artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: ./artifacts_dist | |
| - name: merge | |
| run: | | |
| set -euo pipefail | |
| # Uncompress. | |
| mkdir -p dist | |
| for ad in ./artifacts_dist/*; do | |
| if [ -d "$ad" ]; then | |
| for f in "$ad"/*.tar.gz; do | |
| if [ -f "$f" ]; then | |
| mkdir -p "$ad/extracted" | |
| tar -xzf "$f" -C "$ad/extracted" | |
| fi | |
| done | |
| cp -a "$ad/extracted/dist/"* ./dist/ | |
| fi | |
| done | |
| # Merge. | |
| find ./artifacts_dist -maxdepth 3 -type d -name 'crown-*' -exec cp -a {} ./dist/ \; | |
| - name: detect-version | |
| id: version | |
| run: | | |
| set -euo pipefail | |
| . ./scripts/dist/version.sh | |
| CROWN_VER=$(crown_version) | |
| COMMIT=$(git rev-parse --short HEAD) | |
| if [ "${IS_TAG}" = "true" ]; then | |
| VERSIONNAME=crown-${CROWN_VER} | |
| else | |
| VERSIONNAME=crown-${CROWN_VER}-${BRANCH}-${COMMIT} | |
| fi | |
| DIST_DIR="dist/${VERSIONNAME}" | |
| echo "DIST_DIR=$DIST_DIR" >> $GITHUB_ENV | |
| echo "VERSIONNAME=$VERSIONNAME" >> $GITHUB_ENV | |
| echo "crown_version=${CROWN_VER}" >> $GITHUB_OUTPUT | |
| echo "commit=${COMMIT}" >> $GITHUB_OUTPUT | |
| echo "revision=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT | |
| - name: finalize | |
| run: | | |
| set -euo pipefail | |
| "$GITHUB_WORKSPACE/scripts/dist/finalize.sh" "${DIST_DIR}" | |
| - name: sums | |
| run: | | |
| set -euo pipefail | |
| "$GITHUB_WORKSPACE/scripts/dist/sums.sh" "${DIST_DIR}" | |
| - name: install-rclone | |
| if: github.event_name == 'push' && env.IS_TAG == 'false' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rclone | |
| - name: unstable | |
| id: nightly | |
| if: github.event_name == 'push' && env.IS_TAG == 'false' | |
| env: | |
| GDRIVE_KEY: ${{ secrets.GDRIVE_KEY }} | |
| GDRIVE_PARENT_FOLDER_ID: ${{ secrets.GDRIVE_PARENT_FOLDER_ID }} | |
| run: | | |
| set -euo pipefail | |
| CREDENTIALS="${RUNNER_TEMP}/gdrive.json" | |
| trap 'rm -f "${CREDENTIALS}"' EXIT | |
| umask 077 | |
| printf '%s' "${GDRIVE_KEY}" > "${CREDENTIALS}" | |
| export RCLONE_CONFIG_GDRIVE_TYPE=drive | |
| export RCLONE_CONFIG_GDRIVE_ROOT_FOLDER_ID="${GDRIVE_PARENT_FOLDER_ID}" | |
| export RCLONE_CONFIG_GDRIVE_SERVICE_ACCOUNT_FILE="${CREDENTIALS}" | |
| rclone copy "${DIST_DIR}/" "gdrive:${VERSIONNAME}/" --checksum | |
| GDRIVE_FILE_ID=$(rclone lsf "gdrive:${VERSIONNAME}" \ | |
| --files-only \ | |
| --include "${VERSIONNAME}-linux-x64.tar.gz" \ | |
| --format i) | |
| echo "gdrive_file_id=${GDRIVE_FILE_ID}" >> $GITHUB_OUTPUT | |
| - name: stable | |
| if: github.event_name == 'push' && env.IS_TAG == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: ${{ env.DIST_DIR }}/* | |
| update-website: | |
| needs: finalize | |
| if: github.event_name == 'push' && github.ref_type == 'tag' | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: crownengine/crown-website | |
| ref: master | |
| token: ${{ secrets.WEBSITE_TOKEN }} | |
| - name: update-download | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| ./update-download.sh | |
| git push origin master | |
| aur-source: | |
| needs: finalize | |
| if: github.event_name == 'push' && github.ref_type == 'tag' | |
| continue-on-error: true | |
| runs-on: ubuntu-22.04 | |
| container: archlinux:base-devel | |
| permissions: | |
| contents: read | |
| env: | |
| CROWN_VERSION: ${{ needs.finalize.outputs.crown_version }} | |
| steps: | |
| - name: install-deps | |
| run: pacman -Syu --noconfirm git openssh pacman-contrib | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| - name: prepare-aur-ssh | |
| shell: bash | |
| env: | |
| AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| AUR_KNOWN_HOSTS: ${{ secrets.AUR_KNOWN_HOSTS }} | |
| AUR_GIT_NAME: ${{ vars.AUR_GIT_NAME }} | |
| AUR_GIT_EMAIL: ${{ vars.AUR_GIT_EMAIL }} | |
| run: | | |
| set -euo pipefail | |
| test -n "${AUR_SSH_PRIVATE_KEY}" | |
| test -n "${AUR_KNOWN_HOSTS}" | |
| useradd --create-home aur-builder | |
| install -d -m700 -o aur-builder -g aur-builder /home/aur-builder/.ssh | |
| printf '%s\n' "${AUR_SSH_PRIVATE_KEY}" > /home/aur-builder/.ssh/id_ed25519 | |
| printf '%s\n' "${AUR_KNOWN_HOSTS}" > /home/aur-builder/.ssh/known_hosts | |
| chown aur-builder:aur-builder /home/aur-builder/.ssh/id_ed25519 /home/aur-builder/.ssh/known_hosts | |
| chmod 600 /home/aur-builder/.ssh/id_ed25519 | |
| chmod 644 /home/aur-builder/.ssh/known_hosts | |
| runuser -u aur-builder -- env HOME=/home/aur-builder git config --global user.name "${AUR_GIT_NAME:-Crown Engine CI}" | |
| runuser -u aur-builder -- env HOME=/home/aur-builder git config --global user.email "${AUR_GIT_EMAIL:-crownengine@users.noreply.github.com}" | |
| - name: publish-aur | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| run_as_builder () { | |
| # shellcheck disable=SC2016 | |
| runuser -u aur-builder -- env HOME=/home/aur-builder \ | |
| bash -c 'cd "$1"; shift; exec "$@"' _ "$@" | |
| } | |
| AUR_DIR=/home/aur-builder/crown | |
| runuser -u aur-builder -- env HOME=/home/aur-builder \ | |
| git clone ssh://aur@aur.archlinux.org/crown.git "${AUR_DIR}" | |
| run_as_builder "${AUR_DIR}" "${GITHUB_WORKSPACE}/scripts/dist/aur.sh" \ | |
| --build-release "${CROWN_VERSION}" 1 | |
| run_as_builder "${AUR_DIR}" "${GITHUB_WORKSPACE}/scripts/dist/aur.sh" --publish | |
| aur-binary: | |
| needs: finalize | |
| if: github.event_name == 'push' | |
| continue-on-error: true | |
| runs-on: ubuntu-22.04 | |
| container: archlinux:base-devel | |
| permissions: | |
| contents: read | |
| env: | |
| IS_TAG: ${{ github.ref_type == 'tag' }} | |
| CROWN_VERSION: ${{ needs.finalize.outputs.crown_version }} | |
| COMMIT: ${{ needs.finalize.outputs.commit }} | |
| REVISION: ${{ needs.finalize.outputs.revision }} | |
| GDRIVE_FILE_ID: ${{ needs.finalize.outputs.gdrive_file_id }} | |
| steps: | |
| - name: install-deps | |
| run: pacman -Syu --noconfirm git openssh pacman-contrib | |
| - name: prepare | |
| uses: actions/checkout@v6 | |
| - name: prepare-aur-ssh | |
| shell: bash | |
| env: | |
| AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| AUR_KNOWN_HOSTS: ${{ secrets.AUR_KNOWN_HOSTS }} | |
| AUR_GIT_NAME: ${{ vars.AUR_GIT_NAME }} | |
| AUR_GIT_EMAIL: ${{ vars.AUR_GIT_EMAIL }} | |
| run: | | |
| set -euo pipefail | |
| test -n "${AUR_SSH_PRIVATE_KEY}" | |
| test -n "${AUR_KNOWN_HOSTS}" | |
| useradd --create-home aur-builder | |
| install -d -m700 -o aur-builder -g aur-builder /home/aur-builder/.ssh | |
| printf '%s\n' "${AUR_SSH_PRIVATE_KEY}" > /home/aur-builder/.ssh/id_ed25519 | |
| printf '%s\n' "${AUR_KNOWN_HOSTS}" > /home/aur-builder/.ssh/known_hosts | |
| chown aur-builder:aur-builder /home/aur-builder/.ssh/id_ed25519 /home/aur-builder/.ssh/known_hosts | |
| chmod 600 /home/aur-builder/.ssh/id_ed25519 | |
| chmod 644 /home/aur-builder/.ssh/known_hosts | |
| runuser -u aur-builder -- env HOME=/home/aur-builder git config --global user.name "${AUR_GIT_NAME:-Crown Engine CI}" | |
| runuser -u aur-builder -- env HOME=/home/aur-builder git config --global user.email "${AUR_GIT_EMAIL:-crownengine@users.noreply.github.com}" | |
| - name: publish-aur | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| run_as_builder () { | |
| # shellcheck disable=SC2016 | |
| runuser -u aur-builder -- env HOME=/home/aur-builder \ | |
| bash -c 'cd "$1"; shift; exec "$@"' _ "$@" | |
| } | |
| if [ "${IS_TAG}" = "true" ]; then | |
| AUR_PACKAGE=crown-bin | |
| else | |
| AUR_PACKAGE=crown-nightly-bin | |
| fi | |
| AUR_DIR="/home/aur-builder/${AUR_PACKAGE}" | |
| runuser -u aur-builder -- env HOME=/home/aur-builder \ | |
| git clone "ssh://aur@aur.archlinux.org/${AUR_PACKAGE}.git" "${AUR_DIR}" | |
| if [ "${IS_TAG}" = "true" ]; then | |
| run_as_builder "${AUR_DIR}" "${GITHUB_WORKSPACE}/scripts/dist/aur.sh" \ | |
| --build-release "${CROWN_VERSION}" 1 | |
| else | |
| run_as_builder "${AUR_DIR}" "${GITHUB_WORKSPACE}/scripts/dist/aur.sh" \ | |
| --build-nightly "${CROWN_VERSION}.r${REVISION}.g${COMMIT}" 1 \ | |
| "${CROWN_VERSION}" "${COMMIT}" "${GDRIVE_FILE_ID}" | |
| fi | |
| run_as_builder "${AUR_DIR}" "${GITHUB_WORKSPACE}/scripts/dist/aur.sh" --publish |