From 830e1670274c39469207caa566bb5c9f288b36a4 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Wed, 24 Jan 2024 11:16:59 +0100 Subject: [PATCH] CI: Install nightlies to the 0.0.0 nightly tag --- .github/workflows/linux-build.yml | 38 ++++++++++++++++++++++------- .github/workflows/macos-build.yml | 38 ++++++++++++++++++++++------- .github/workflows/msys2-build.yml | 28 ++++++++++++++++++--- .github/workflows/wasm-build.yml | 27 +++++++++++++++++--- .github/workflows/windows-build.yml | 27 +++++++++++++++++--- 5 files changed, 128 insertions(+), 30 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index cc0829f04..c1a13fc99 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -24,11 +24,11 @@ jobs: os: [ubuntu-latest] arch: [x86_64] confs: - - { mode: debug } - - { mode: debug, config: --asan=y } - - { mode: debug, config: --lsan=y } - - { mode: debug, config: --tsan=y } - - { mode: releasedbg } + - { mode: debug, archive: yes } + - { mode: debug, config: --asan=y, archive: false } + - { mode: debug, config: --lsan=y, archive: false } + - { mode: debug, config: --tsan=y, archive: false } + - { mode: releasedbg, archive: yes } runs-on: ${{ matrix.os }} if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} @@ -98,14 +98,34 @@ jobs: # Setup installation configuration - name: Configure xmake for installation + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes # Install the result files - name: Install Nazara + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} run: xmake install -vo package - # Upload artifacts - - uses: actions/upload-artifact@v3 + - name: "Set PACKAGE_NAME variable" + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} + run: echo "PACKAGE_NAME=Linux_${{ matrix.arch }}_${{ matrix.confs.mode }}.tar.gz" >> $GITHUB_ENV + shell: bash + + - name: Archive result + uses: ihiroky/archive-action@v1 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} with: - name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.confs.mode }} - path: package + root_dir: package + file_path: ${{ env.PACKAGE_NAME }} + verbose: true + + # Nightly tags (for commits to main branch) + - name: Upload binaries to release (main) + uses: svenstaro/upload-release-action@v2 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.PACKAGE_NAME }} + asset_name: ${{ env.PACKAGE_NAME }} + tag: "0.0.0-nightly" + overwrite: true diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 24437213b..c5dc55d3d 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -24,11 +24,11 @@ jobs: os: [macOS-latest] arch: [x86_64] confs: - - { mode: debug } - - { mode: debug, config: --asan=y } - - { mode: debug, config: --lsan=y } - - { mode: debug, config: --tsan=y } - - { mode: releasedbg } + - { mode: debug, archive: yes } + - { mode: debug, config: --asan=y, archive: false } + - { mode: debug, config: --lsan=y, archive: false } + - { mode: debug, config: --tsan=y, archive: false } + - { mode: releasedbg, archive: yes } runs-on: ${{ matrix.os }} if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} @@ -92,14 +92,34 @@ jobs: # Setup installation configuration - name: Configure xmake for installation + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.confs.mode }} ${{ matrix.confs.config }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes # Install the result files - name: Install Nazara + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} run: xmake install -vo package - # Upload artifacts - - uses: actions/upload-artifact@v3 + - name: "Set PACKAGE_NAME variable" + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} + run: echo "PACKAGE_NAME=macOS_${{ matrix.arch }}_${{ matrix.confs.mode }}.tar.gz" >> $GITHUB_ENV + shell: bash + + - name: Archive result + uses: ihiroky/archive-action@v1 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} with: - name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.confs.mode }} - path: package + root_dir: package + file_path: ${{ env.PACKAGE_NAME }} + verbose: true + + # Nightly tags (for commits to main branch) + - name: Upload binaries to release (main) + uses: svenstaro/upload-release-action@v2 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' && matrix.confs.archive }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.PACKAGE_NAME }} + asset_name: ${{ env.PACKAGE_NAME }} + tag: "0.0.0-nightly" + overwrite: true diff --git a/.github/workflows/msys2-build.yml b/.github/workflows/msys2-build.yml index 252d016af..cce6d1d2f 100644 --- a/.github/workflows/msys2-build.yml +++ b/.github/workflows/msys2-build.yml @@ -92,14 +92,34 @@ jobs: # Setup installation configuration - name: Configure xmake for installation + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --ffmpeg=n --shadernodes=y --tests=y --yes # Install the result files - name: Install Nazara + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} run: xmake install -vo package - # Upload artifacts - - uses: actions/upload-artifact@v3 + - name: "Set PACKAGE_NAME variable" + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + run: echo "PACKAGE_NAME=${{ matrix.msystem }}_${{ matrix.arch }}_${{ matrix.mode }}.zip" >> $GITHUB_ENV + shell: bash + + - name: Archive result + uses: ihiroky/archive-action@v1 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} with: - name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }} - path: package + root_dir: package + file_path: ${{ env.PACKAGE_NAME }} + verbose: true + + # Nightly tags (for commits to main branch) + - name: Upload binaries to release (main) + uses: svenstaro/upload-release-action@v2 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.PACKAGE_NAME }} + asset_name: ${{ env.PACKAGE_NAME }} + tag: "0.0.0-nightly" + overwrite: true diff --git a/.github/workflows/wasm-build.yml b/.github/workflows/wasm-build.yml index 2d6d434f5..ebc3268ea 100644 --- a/.github/workflows/wasm-build.yml +++ b/.github/workflows/wasm-build.yml @@ -88,10 +88,29 @@ jobs: # Install the result files - name: Install Nazara + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} run: xmake install -vo package - # Upload artifacts - - uses: actions/upload-artifact@v3 + - name: "Set PACKAGE_NAME variable" + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + run: echo "PACKAGE_NAME=Web_${{ matrix.arch }}_${{ matrix.mode }}.tar.gz" >> $GITHUB_ENV + shell: bash + + - name: Archive result + uses: ihiroky/archive-action@v1 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} with: - name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }} - path: package + root_dir: package + file_path: ${{ env.PACKAGE_NAME }} + verbose: true + + # Nightly tags (for commits to main branch) + - name: Upload binaries to release (main) + uses: svenstaro/upload-release-action@v2 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.PACKAGE_NAME }} + asset_name: ${{ env.PACKAGE_NAME }} + tag: "0.0.0-nightly" + overwrite: true diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 4d9b8daab..9a42882b8 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -91,10 +91,29 @@ jobs: # Install the result files - name: Install Nazara + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} run: xmake install -vo package - # Upload artifacts - - uses: actions/upload-artifact@v3 + - name: "Set PACKAGE_NAME variable" + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + run: echo "PACKAGE_NAME=Windows_${{ matrix.arch }}_${{ matrix.mode }}.zip" >> $GITHUB_ENV + shell: bash + + - name: Archive result + uses: ihiroky/archive-action@v1 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} with: - name: nazaraengine-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }} - path: package + root_dir: package + file_path: ${{ env.PACKAGE_NAME }} + verbose: true + + # Nightly tags (for commits to main branch) + - name: Upload binaries to release (main) + uses: svenstaro/upload-release-action@v2 + if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.PACKAGE_NAME }} + asset_name: ${{ env.PACKAGE_NAME }} + tag: "0.0.0-nightly" + overwrite: true