diff --git a/.github/workflows/build-and-deploy-release.yml b/.github/workflows/build-and-deploy-release.yml deleted file mode 100644 index 77ca7dfc5..000000000 --- a/.github/workflows/build-and-deploy-release.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: build and deploy release -on: - release: - types: [published] -jobs: - windows-build: - if: github.repository == 'QW-Group/ezquake-source' - runs-on: windows-latest - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 - - - name: Run CMake - uses: lukka/run-cmake@v10 - with: - configurePreset: msbuild-x64 - buildPreset: msbuild-x64-release - - - name: Create checksum - run: | - cp build-msbuild-*/Release/ezquake.exe . - md5sum ezquake.exe > ezquake.md5 - - - name: Invoke msys - uses: msys2/setup-msys2@v2 - with: - install: openssh - - - name: Setup SSH - env: - SSH_AUTH_SOCK: C:\ssh_agent.sock - shell: msys2 {0} - run: | - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" - - name: Set date - shell: msys2 {0} - run: | - export TZ=CET-1CEST - echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV - - name: Deploy - env: - SSH_AUTH_SOCK: C:\ssh_agent.sock - shell: msys2 {0} - run: | - mkdir -p upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }} - mkdir -p upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }} - cp ezquake.exe upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe - cp ezquake.md5 upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5 - cp ezquake.exe upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe - cp ezquake.md5 upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5 - sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/releases <<< $'put -rp upload/releases/*' - - linux-build: - if: github.repository == 'QW-Group/ezquake-source' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [linux-x86_64] - include: - - target: linux-x86_64 - platform: x86_64 - container: - image: debian:testing - options: --privileged - - steps: - - name: Install dependencies - run: apt-get -qy update && apt-get -qy install curl file libfuse2 git make sudo git - - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - - - name: Build - run: git config --global --add safe.directory $PWD && ./misc/appimage/appimage-manual_creation.sh - - - name: Create checksum - run: | - md5sum ezQuake-${{ matrix.platform }}.AppImage > ezQuake-${{ matrix.platform }}.AppImage.md5 - - - name: Setup SSH - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" - - name: Set date - shell: bash - run: | - export TZ=CET-1CEST - echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV - - name: Deploy - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - mkdir -p upload/releases/${{ github.ref_name }}/linux - mkdir -p upload/releases/latest/linux/${{ matrix.platform }} - cp ezQuake-${{ matrix.platform }}.AppImage upload/releases/${{ github.ref_name }}/linux/ezQuake-${{ matrix.platform }}.AppImage - cp ezQuake-${{ matrix.platform }}.AppImage.md5 upload/releases/${{ github.ref_name }}/linux/ezQuake-${{ matrix.platform }}.AppImage.md5 - cp ezQuake-${{ matrix.platform }}.AppImage upload/releases/latest/linux/${{ matrix.platform }}/ezQuake-${{ matrix.platform }}.AppImage - cp ezQuake-${{ matrix.platform }}.AppImage.md5 upload/releases/latest/linux/${{ matrix.platform }}/ezQuake-${{ matrix.platform }}.AppImage.md5 - sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/releases <<< $'put -rp upload/releases/*' diff --git a/.github/workflows/build-and-deploy-snapshots.yml b/.github/workflows/build-and-deploy-snapshots.yml deleted file mode 100644 index 364aa28e5..000000000 --- a/.github/workflows/build-and-deploy-snapshots.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: build and deploy snapshots -on: [push] -jobs: - windows-build: - if: github.repository == 'QW-Group/ezquake-source' - runs-on: windows-latest - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 - - - name: Run CMake - uses: lukka/run-cmake@v10 - with: - configurePreset: msbuild-x64 - buildPreset: msbuild-x64-release - - - name: Create checksum - run: | - cp build-msbuild-*/Release/ezquake.exe . - md5sum ezquake.exe > ezquake.md5 - - - name: Invoke msys - uses: msys2/setup-msys2@v2 - with: - install: openssh - - - name: Setup SSH - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" - - name: Set date - shell: bash - run: | - export TZ=CET-1CEST - echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV - - name: Deploy - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - mkdir -p upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }} - mkdir -p upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }} - cp ezquake.exe upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.exe - cp ezquake.md5 upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.md5 - cp ezquake.exe upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe - cp ezquake.md5 upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5 - sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/snapshots <<< $'put -rp upload/snapshots/*' - - linux-build: - if: github.repository == 'QW-Group/ezquake-source' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [linux-x86_64] - include: - - target: linux-x86_64 - platform: x86_64 - container: - image: debian:testing - options: --privileged - - steps: - - name: Install dependencies - run: apt-get -qy update && apt-get -qy install curl file libfuse2 git make sudo git ssh-client - - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - - - name: Build - run: git config --global --add safe.directory $PWD && ./misc/appimage/appimage-manual_creation.sh - - - name: Build - run: ./misc/appimage/appimage-manual_creation.sh - - - name: Create checksum - run: | - md5sum ezQuake-${{ matrix.platform }}.AppImage > ezQuake-${{ matrix.platform }}.AppImage.md5 - - - name: Setup SSH - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - ssh-agent -a $SSH_AUTH_SOCK > /dev/null - ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" - - name: Set date - shell: bash - run: | - export TZ=CET-1CEST - echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV - - name: Deploy - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - shell: bash - run: | - mkdir -p upload/snapshots/linux/${{ matrix.platform }} - mkdir -p upload/snapshots/latest/linux/${{ matrix.platform }} - cp ezQuake-${{ matrix.platform }}.AppImage upload/snapshots/linux/${{ matrix.platform }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezQuake-${{ matrix.platform }}.AppImage - cp ezQuake-${{ matrix.platform }}.AppImage.md5 upload/snapshots/linux/${{ matrix.platform }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezQuake-${{ matrix.platform }}.AppImage.md5 - cp ezQuake-${{ matrix.platform }}.AppImage upload/snapshots/latest/linux/${{ matrix.platform }}/ezQuake-${{ matrix.platform }}.AppImage - cp ezQuake-${{ matrix.platform }}.AppImage.md5 upload/snapshots/latest/linux/${{ matrix.platform }}/ezQuake-${{ matrix.platform }}.AppImage.md5 - sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/snapshots <<< $'put -rp upload/snapshots/*' diff --git a/.github/workflows/build-targets.yml b/.github/workflows/build-targets.yml deleted file mode 100644 index ac4283254..000000000 --- a/.github/workflows/build-targets.yml +++ /dev/null @@ -1,156 +0,0 @@ -name: build targets -on: [push, pull_request, workflow_dispatch] -jobs: - windows-build: - runs-on: windows-latest - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Fetch upstream tags for version metadata - run: | - git remote add upstream https://github.com/QW-Group/ezquake-source.git - git fetch --tags --no-recurse-submodules upstream - if: github.repository != 'QW-Group/ezquake-source' - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 - - - name: Run CMake - uses: lukka/run-cmake@v10 - with: - configurePreset: msbuild-x64 - buildPreset: msbuild-x64-release - - - name: Archive client - uses: actions/upload-artifact@v4 - with: - name: windows-multi-x64 - path: build-msbuild-x64/Release/ezquake.exe - - macos-build: - runs-on: macos-latest - strategy: - matrix: - ARCH: ["arm64","x64"] - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Fetch upstream tags for version metadata - run: | - git remote add upstream https://github.com/QW-Group/ezquake-source.git - git fetch --tags --no-recurse-submodules upstream - if: github.repository != 'QW-Group/ezquake-source' - - - name: Install macOS build dependencies - run: brew install -q autoconf automake libtool - - - uses: lukka/get-cmake@latest - - - name: Setup vcpkg - uses: lukka/run-vcpkg@v11 - - - name: Run CMake - uses: lukka/run-cmake@v10 - with: - configurePreset: macos-${{matrix.ARCH}}-release-ci - buildPreset: macos-${{matrix.ARCH}}-release-ci - - - name: Pre-zip to preserve executable bit - run: | - zip -r -9 ${GITHUB_WORKSPACE}/ezQuake.zip ezQuake.app - working-directory: build-macos-${{matrix.ARCH}}-release-ci/Release - - - uses: actions/upload-artifact@v4 - with: - name: ezQuake-macos-${{matrix.ARCH}} - path: ezQuake.zip - - macos-universal: - needs: macos-build - runs-on: macos-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Download Intel Build - uses: actions/download-artifact@v4 - with: - name: ezQuake-macos-arm64 - path: artifacts/arm64 - - - name: Download ARM64 Build - uses: actions/download-artifact@v4 - with: - name: ezQuake-macos-x64 - path: artifacts/x64 - - - name: Create Universal Binary - run: | - (cd artifacts/x64 && unzip -qq ezQuake.zip) && (cd artifacts/arm64 && unzip -qq ezQuake.zip) - cp -r artifacts/arm64/ezQuake.app . - lipo -create -output ezQuake.app/Contents/MacOS/ezQuake \ - artifacts/x64/ezQuake.app/Contents/MacOS/ezQuake \ - artifacts/arm64/ezQuake.app/Contents/MacOS/ezQuake - codesign --force --sign - --entitlements dist/macOS/ezquake.entitlements.plist --options runtime --timestamp ezQuake.app - zip -r ezQuake.zip ezQuake.app - - - name: Delete macOS arch specific builds - uses: geekyeggo/delete-artifact@v5 - with: - name: | - ezQuake-macos-arm64 - ezQuake-macos-x64 - - - name: Upload Build Artifact - uses: actions/upload-artifact@v4 - with: - name: ezQuake-macOS - path: ezQuake.zip - compression-level: 9 - - appimage-build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [linux-x86_64] - include: - - target: linux-x86_64 - platform: x86_64 - container: - image: debian:testing - options: --privileged - - steps: - - name: Install dependencies - run: apt-get -qy update && apt-get -qy install curl file libfuse2 git make sudo git - - - name: Check out code - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - - - name: Fetch upstream tags for version metadata - run: | - git config --global --add safe.directory '*' # container build workaround - git remote add upstream https://github.com/QW-Group/ezquake-source.git - git fetch --tags --no-recurse-submodules upstream - if: github.repository != 'QW-Group/ezquake-source' - - - name: Build - run: git config --global --add safe.directory $PWD && ./misc/appimage/appimage-manual_creation.sh - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-AppImage - path: ezQuake-${{ matrix.platform }}.AppImage diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..aaa70c379 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,314 @@ +name: main + +on: + push: + # Only build branches on push, tags will be handled by 'release' job. + branches: + - '**' + pull_request: + workflow_dispatch: + release: + types: [created] + +jobs: + build: + strategy: + matrix: + include: + - os: windows-latest + configurePreset: msbuild-x64 + buildPreset: msbuild-x64-release + name: ezQuake-windows-x64 + artifact: "ezquake.exe" + container: null + - os: macos-latest + configurePreset: macos-arm64-release-ci + buildPreset: macos-arm64-release-ci + name: ezQuake-macOS-arm64 + artifact: "ezQuake.zip" + packages: ["autoconf", "automake", "libtool"] + container: null + - os: macos-latest + configurePreset: macos-x64-release-ci + buildPreset: macos-x64-release-ci + name: ezQuake-macOS-x64 + artifact: "ezQuake.zip" + packages: ["autoconf", "automake", "libtool"] + container: null + - os: ubuntu-latest + configurePreset: dynamic + buildPreset: dynamic-release + name: ezQuake-linux-x86_64 + artifact: "ezQuake-x86_64.AppImage" + cflags: "-march=nehalem" + packages: ["build-essential", "ca-certificates", "cmake", "curl", "file", "git", "libcurl4-openssl-dev", "libexpat1-dev", "libfreetype-dev", "libfuse2", "libjansson-dev", "libjpeg-dev", "libminizip-dev", "libpcre2-dev", "libpng-dev", "libsdl2-2.0-0", "libsdl2-dev", "libsndfile1-dev", "libspeex-dev", "libspeexdsp-dev", "ninja-build", "sudo", "unzip"] + container: + image: debian:testing + options: --privileged + + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + container: ${{ matrix.container }} + + steps: + - name: Prepare Linux environment + run: | + apt-get -qq update && apt-get -qq install --no-install-recommends ${{ join(matrix.packages, ' ') }} + git config --global --add safe.directory $PWD + if: matrix.os == 'ubuntu-latest' + + - name: Prepare macOS environment + run: brew install -q ${{ join(matrix.packages, ' ') }} + if: matrix.os == 'macos-latest' + + - name: Check out code + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 # To get correct revision + + - name: Fetch upstream tags for version metadata + run: | + git remote add upstream https://github.com/QW-Group/ezquake-source.git + git fetch --tags --no-recurse-submodules upstream + if: github.repository != 'QW-Group/ezquake-source' + + - uses: lukka/get-cmake@latest + with: + cmakeVersion: "~3.28.0" + if: matrix.os != 'ubuntu-latest' + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11 + if: matrix.os != 'ubuntu-latest' # Only used for static builds + + - name: Run CMake + uses: lukka/run-cmake@v10 + with: + configurePreset: ${{ matrix.configurePreset }} + buildPreset: ${{ matrix.buildPreset }} + env: + CFLAGS: ${{ matrix.cflags }} + + - name: Generate Linux AppImage + run: | + export EXECUTABLE=$(echo build-${{ matrix.configurePreset }}/Release/ezquake*) + ./misc/appimage/appimage-manual_creation.sh + mv ezQuake-x86_64.AppImage build-${{ matrix.configurePreset }}/Release/ + if: matrix.os == 'ubuntu-latest' + + - name: Preserve macOS executable bit + run: | + zip -r -9 ezQuake.zip ezQuake.app + working-directory: build-${{ matrix.configurePreset }}/Release + if: matrix.os == 'macos-latest' + + - name: Archive client + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }} + path: | + build-${{ matrix.configurePreset }}/Release/${{ matrix.artifact }} + compression-level: 9 + + macos-universal: + needs: build + + name: "ezQuake-macOS-universal" + runs-on: macos-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Download ARM64 Build + uses: actions/download-artifact@v4 + with: + name: ezQuake-macOS-arm64 + path: artifacts/arm64 + + - name: Download Intel Build + uses: actions/download-artifact@v4 + with: + name: ezQuake-macOS-x64 + path: artifacts/x64 + + - name: Create Universal Binary + run: | + (cd artifacts/x64 && unzip -qq ezQuake.zip) && (cd artifacts/arm64 && unzip -qq ezQuake.zip) + cp -r artifacts/arm64/ezQuake.app . + lipo -create -output ezQuake.app/Contents/MacOS/ezQuake \ + artifacts/x64/ezQuake.app/Contents/MacOS/ezQuake \ + artifacts/arm64/ezQuake.app/Contents/MacOS/ezQuake + codesign --force --sign - --entitlements dist/macOS/ezquake.entitlements.plist --options runtime --timestamp ezQuake.app + zip -r ezQuake-macOS-universal.zip ezQuake.app + + - name: Delete macOS arch specific builds + uses: geekyeggo/delete-artifact@v5 + with: + name: | + ezQuake-macOS-arm64 + ezQuake-macOS-x64 + + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: ezQuake-macOS-universal + path: ezQuake-macOS-universal.zip + compression-level: 9 + + upload: +# TODO +# if: github.repository == 'QW-Group/ezquake-source' && ((github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release') + needs: [macos-universal] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: ezquake + submodules: true + fetch-depth: 0 # To get correct revision +# TODO +# if: github.event_name == 'release' + + - name: Get release date + run: | + RELEASE_DATE=$(git log -1 --format=%cI "${{ github.ref_name }}") + echo "RELEASE_DATE=$RELEASE_DATE" >> $GITHUB_ENV + working-directory: ezquake +# TODO +# if: github.event_name == 'release' + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Collect GitHub release artifacts + run: | + set -e + + dist_dir="${GITHUB_WORKSPACE}/dist" + mkdir "${dist_dir}" + + # Reset timestamp to time of commit before compression + find "artifacts" -type f -exec touch --date="${RELEASE_DATE}" {} + + + # Recompress before attaching to release, avoiding double-zip of macOS + ( + cd artifacts + for target in *; do + if ls "${target}"/*.zip &> /dev/null; then + cp "${target}"/*.zip "${dist_dir}/${target}.zip" + else + (cd "${target}"; zip -o -9 "${dist_dir}/${target}.zip" *) + fi + done; + ) + + # Generate source release with submodule, version.json etc + ( + cd "${GITHUB_WORKSPACE}/ezquake" + dist/gen-release.sh + mv *.tar.gz "${dist_dir}/" + ) + + find "${dist_dir}" -type f -execdir sha256sum {} \; > "checksums.txt" + mv "checksums.txt" "${dist_dir}/" + + # Reset timestamp to time of commit for all release artifacts + find "${dist_dir}" -type f -exec touch --date="${RELEASE_DATE}" {} + + + # TODO: Remove + find "${dist_dir}" + cat "${dist_dir}/checksums.txt" + + echo "GITHUB_ARTIFACTS=$dist_dir" >> $GITHUB_ENV +# TODO +# if: github.event_name == 'release' + + - name: Attach artifacts to GitHub release + uses: softprops/action-gh-release@v2 + with: + files: ${{ env.GITHUB_ARTIFACTS }}/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: github.event_name == 'release' + + - name: Prepare Upload Environemnt + run: | + sudo apt-get -qq update + sudo apt-get -qq --no-install-recommends install openssh-client + + - name: Setup SSH + run: | + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + if: github.repository == 'QW-Group/ezquake-source' # TODO remove + + - name: Prepare upload to builds.quakeworld.nu + run: | + # Build file structure for uploading + # snapshots: + # upload/snapshots/latest/$os/$arch/$filename + # upload/snapshots/$os/$arch/$prefix_$filename + # releases: + # upload/releases/latest/$os/$arch/$filename + # upload/releases/$tag/$os/$arch/$filename + + set -e + + upload_dir="${GITHUB_WORKSPACE}/upload" + if [[ $GITHUB_REF == refs/tags/* ]]; then + main_dir="${upload_dir}/releases/${{ github.ref_name }}" + latest_dir="${upload_dir}/releases/latest" + prefix="" + else + main_dir="${upload_dir}/snapshots" + latest_dir="${upload_dir}/snapshots/latest" + date=$(TZ="Europe/Amsterdam" date "+%Y%m%d-%H%M%S") + prefix="${date}_${GITHUB_SHA::7}_" + fi + + # Collect upload structure + for artifact in artifacts/*/*; do + artifact_file=$(basename "${artifact}") + artifact_dir=$(dirname "${artifact}") + + IFS='-' read -r ezq os arch <<< "${artifact_dir}" + + mkdir -p "${main_dir}/${os}/${arch}" "${latest_dir}/${os}/${arch}" + + cp "${artifact}" "${main_dir}/${os}/${arch}/${prefix}${artifact_file}" + cp "${artifact}" "${latest_dir}/${os}/${arch}/${artifact_file}" + done + + # Generate checksums + for artifact in $(find "${upload_dir}" -type f); do + artifact_file=$(basename "${artifact}") + artifact_dir=$(dirname "${artifact}") + (cd "${artifact_dir}" && md5sum "${artifact_file}" > "${artifact_file}.md5") + done + + # Reset timestamp to time of commit + find "${upload_dir}" -type f -exec touch --date="${RELEASE_DATE}" {} + + + # TODO: Remove + find "${upload_dir}" + + - name: Upload to builds.quakeworld.nu/ezquake/snapshots + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/snapshots <<< $'put -rp upload/snapshots/*' + if: github.event_name == 'push' && github.repository == 'QW-Group/ezquake-source' # TODO remove + + - name: Upload to builds.quakeworld.nu/ezquake/releases + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + run: | + sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/releases <<< $'put -rp upload/releases/*' + if: github.event_name == 'release' && github.repository == 'QW-Group/ezquake-source' # TODO remove \ No newline at end of file