From 72ee28424be26f1a7287331b81cafb285551c780 Mon Sep 17 00:00:00 2001 From: Jonathan Linat Date: Tue, 31 Dec 2024 09:53:42 -0500 Subject: [PATCH 1/2] ci: add action to upload built patch files --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4594429..0f8c1954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,55 +1,68 @@ name: CI - on: push: pull_request: - env: BUILD_TYPE: Release - + WORKING_DIRECTORY: ${{ github.workspace }}/build jobs: build-mingw: runs-on: ubuntu-24.04 - steps: - - name: Install packages run: | sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install --no-install-recommends g++-mingw-w64-i686-posix ninja-build wine32 wine - + shell: bash - uses: actions/checkout@v4 - + - name: Set Current Git Commit Head SHA + run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV + shell: bash - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - + run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} + shell: bash - name: Configure CMake - working-directory: ${{github.workspace}}/build + working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-ubuntu.cmake - + shell: bash - name: Print nproc run: nproc - - name: Build - working-directory: ${{github.workspace}}/build + working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake --build . -j $(nproc) - + shell: bash + - name: Upload Patch Files + uses: actions/upload-artifact@v4 + with: + compression-level: 9 + if-no-files-found: error + name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-mingw + path: ${{ env.WORKING_DIRECTORY }} + retention-days: 1 build-msvc: runs-on: windows-latest - steps: - uses: actions/checkout@v4 - + - name: Set Current Git Commit Head SHA + run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV + shell: bash - name: Create Build Environment - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake + run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} shell: cmd - working-directory: ${{github.workspace}}/build + - name: Configure CMake + working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake .. -A Win32 - - - name: Build shell: cmd - working-directory: ${{github.workspace}}/build + - name: Build + working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake --build . --config %BUILD_TYPE% -j 4 + shell: cmd + - name: Upload Patch Files + uses: actions/upload-artifact@v4 + with: + compression-level: 9 + if-no-files-found: error + name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-msvc + path: ${{ env.WORKING_DIRECTORY }} + retention-days: 1 From 79aa4f92822518ec1793a7ba6c50fd9f00abe6db Mon Sep 17 00:00:00 2001 From: Jonathan Linat Date: Wed, 1 Jan 2025 17:28:22 -0500 Subject: [PATCH 2/2] ci: remove retention days for upload and switch to bash shell --- .github/workflows/ci.yml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f8c1954..50344df9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,17 @@ name: CI + on: push: pull_request: + env: BUILD_TYPE: Release WORKING_DIRECTORY: ${{ github.workspace }}/build + jobs: build-mingw: runs-on: ubuntu-24.04 + steps: - name: Install packages run: | @@ -15,54 +19,67 @@ jobs: sudo apt-get update sudo apt-get install --no-install-recommends g++-mingw-w64-i686-posix ninja-build wine32 wine shell: bash + - uses: actions/checkout@v4 + - name: Set Current Git Commit Head SHA run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV shell: bash + - name: Create Build Environment run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} shell: bash + - name: Configure CMake working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-ubuntu.cmake shell: bash + - name: Print nproc run: nproc + shell: bash + - name: Build working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake --build . -j $(nproc) shell: bash + - name: Upload Patch Files uses: actions/upload-artifact@v4 with: compression-level: 9 if-no-files-found: error name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-mingw - path: ${{ env.WORKING_DIRECTORY }} - retention-days: 1 + path: ${{ env.WORKING_DIRECTORY }}/bin + build-msvc: runs-on: windows-latest + steps: - uses: actions/checkout@v4 + - name: Set Current Git Commit Head SHA run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV shell: bash + - name: Create Build Environment run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} - shell: cmd + shell: bash + - name: Configure CMake working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake .. -A Win32 - shell: cmd + shell: bash + - name: Build working-directory: ${{ env.WORKING_DIRECTORY }} run: cmake --build . --config %BUILD_TYPE% -j 4 - shell: cmd + shell: bash + - name: Upload Patch Files uses: actions/upload-artifact@v4 with: compression-level: 9 if-no-files-found: error name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-msvc - path: ${{ env.WORKING_DIRECTORY }} - retention-days: 1 + path: ${{ env.WORKING_DIRECTORY }}/bin