fix typo #4
This file contains 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: "NeL: CI / CD" | |
on: | |
push: | |
branches: [ "core4", "feature/*" ] | |
paths: | |
- .github/workflows/ci-nel.yml | |
- nel/** | |
- CMakeLists.txt | |
- CMakePresets.txt | |
pull_request: | |
branches: [ "core4" ] | |
paths: | |
- .github/workflows/ci-nel.yml | |
- nel/** | |
- CMakeLists.txt | |
- CMakePresets.txt | |
jobs: | |
strings: | |
runs-on: ubuntu-latest | |
outputs: | |
build-output-dir: ${{ steps.strings.outputs.build-output-dir }} | |
build-version: ${{ steps.strings.outputs.build-version }} | |
project-name: ${{ steps.strings.outputs.project-name }} | |
steps: | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build/nel" >> "$GITHUB_OUTPUT" | |
COMMIT_HASH=${{ github.sha }} | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
[ "$VERSION" == "main" ] && VERSION=latest | |
VERSION="$VERSION+sha.${COMMIT_HASH:0:8}" | |
echo VERSION=$VERSION | |
echo "build-version=${VERSION}" >> "$GITHUB_OUTPUT" | |
echo "project-name=nel" >> "$GITHUB_OUTPUT" | |
configure: | |
needs: [ strings ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, windows-2022 ] | |
include: | |
- os: ubuntu-22.04 | |
preset: linux-${{ needs.strings.outputs.project-name }} | |
- os: windows-2022 | |
preset: windows-${{ needs.strings.outputs.project-name }} | |
steps: | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v4 | |
- name: Configure CMake | |
run: cmake --preset ${{ matrix.preset }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: configure-${{ matrix.os }} | |
path: ${{ needs.strings.outputs.build-output-dir }} | |
build: | |
needs: [ strings, configure ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, windows-2022 ] | |
steps: | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: configure-${{ matrix.os }} | |
merge-multiple: true | |
path: ${{ needs.strings.outputs.build-output-dir }} | |
- name: Build | |
run: cmake --build --preset ${{ needs.strings.outputs.project-name }} | |
- name: Test | |
run: ctest --preset ${{ needs.strings.outputs.project-name }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.os }} | |
path: ${{ needs.strings.outputs.build-output-dir }} | |
package: | |
needs: [ strings, build ] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, windows-2022 ] | |
steps: | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: build-${{ matrix.os }} | |
merge-multiple: true | |
path: ${{ needs.strings.outputs.build-output-dir }} | |
- name: Package | |
run: cpack --preset ${{ needs.strings.outputs.project-name }} -R "${{ needs.strings.outputs.build-version }}" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: package-${{ needs.strings.outputs.project-name }}-${{ matrix.os }}-${{ needs.strings.outputs.build-version }} | |
path: ${{ needs.strings.outputs.build-output-dir }}/${{ needs.strings.outputs.project-name }}/ryzomcore-* | |