From 78c21c653f8ca602da02b8a1f017bd279d787ea2 Mon Sep 17 00:00:00 2001 From: nullprop Date: Mon, 6 Jan 2025 19:29:24 +0200 Subject: [PATCH] Update actions --- .forgejo/workflows/ci-cd.yml | 62 +++++++++++++++++++++++++++ .github/workflows/ci-cd.yml | 81 ------------------------------------ 2 files changed, 62 insertions(+), 81 deletions(-) create mode 100644 .forgejo/workflows/ci-cd.yml delete mode 100644 .github/workflows/ci-cd.yml diff --git a/.forgejo/workflows/ci-cd.yml b/.forgejo/workflows/ci-cd.yml new file mode 100644 index 0000000..d96b9b5 --- /dev/null +++ b/.forgejo/workflows/ci-cd.yml @@ -0,0 +1,62 @@ +name: CI/CD + +on: [push, pull_request] + +jobs: + build-linux: + name: Linux-x86-${{ matrix.compiler }} + runs-on: node-bookworm + strategy: + matrix: + compiler: [g++, clang++] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + apt update + apt install -y sudo g++-multilib clang libgl1-mesa-dev zip + + - name: Build + run: | + cd linux + make COMPILER=${{ matrix.compiler }} CFG=release + + - name: Package + run: | + cp -r linux/release/cl_dlls photomode/cl_dlls + cp -r linux/release/dlls photomode/dlls + zip -r photomode-linux-x86-${{ matrix.compiler }}.zip photomode/ + + - name: Deploy + uses: forgejo/upload-artifact@v4 + with: + name: photomode-linux-x86-${{ matrix.compiler }}.zip + path: photomode-linux-x86-${{ matrix.compiler }}.zip + if-no-files-found: error + + release: + name: Release + runs-on: node-bookworm + if: startsWith(github.ref, 'refs/tags/') + needs: build-linux + steps: + - uses: actions/checkout@v4 # needed for release action? + + - name: Download artifacts + uses: forgejo/download-artifact@v4 + with: + path: artifacts + merge-multiple: true + + - run: ls -lah artifacts/ + + - name: Release + uses: actions/forgejo-release@v2 + with: + url: https://code.nullprop.sh + direction: upload + release-dir: artifacts + tag: "${{ github.ref_name }}" + token: ${{ secrets.TOKEN }} diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml deleted file mode 100644 index 5e00803..0000000 --- a/.github/workflows/ci-cd.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: CI/CD - -on: [push, pull_request] - -jobs: - linux: - name: Linux-x86 - runs-on: ubuntu-latest - strategy: - matrix: - compiler: [g++, clang++] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install G++ Multilib, Clang++ & OpenGL library - run: | - sudo apt update - sudo apt install -y g++-multilib clang libgl1-mesa-dev - - - name: Build - run: | - cd linux - make COMPILER=${{ matrix.compiler }} CFG=release -j2 - - - name: Package - run: | - cp -r linux/release/cl_dlls photomode/cl_dlls - cp -r linux/release/dlls photomode/dlls - zip -r photomode-linux.zip photomode - - - name: Deploy - uses: actions/upload-artifact@v4 - with: - name: Linux-x86-${{ matrix.compiler }}-${{ github.sha }} - path: photomode - - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - fail_on_unmatched_files: true - files: photomode-linux.zip - - win32: - name: Win32 - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - with: - msbuild-architecture: x86 - - - name: Build - run: msbuild projects/vs2019/projects.sln -t:rebuild -property:Configuration=Release -maxcpucount:2 - - - name: Package - run: | - mkdir photomode\cl_dlls - mkdir photomode\dlls - copy projects\vs2019\Release\hl_cdll\client.dll photomode\cl_dlls\client.dll - copy projects\vs2019\Release\hl_cdll\client.pdb photomode\cl_dlls\client.pdb - copy projects\vs2019\Release\hldll\hl.dll photomode\dlls\hl.dll - copy projects\vs2019\Release\hldll\hl.pdb photomode\dlls\hl.pdb - Compress-Archive photomode photomode-windows.zip - - - name: Deploy - uses: actions/upload-artifact@v4 - with: - name: Win32-${{ github.sha }} - path: photomode - - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - fail_on_unmatched_files: true - files: photomode-windows.zip