ci(github): update artifact name #734
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: C/C++ CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
env: | ||
TARGET_MAJOR: 3 | ||
TARGET_VERSION: 3.0.0 | ||
TARGET_KIND: static | ||
TARGET_ARCH: x64 | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
Check failure on line 13 in .github/workflows/ccpp.yml GitHub Actions / C/C++ CIInvalid workflow file
|
||
include: | ||
- os: 'ubuntu-latest' | ||
TEST_OPTIONS: --memcheck | ||
TARGET_OS: linux | ||
- os: 'windows-latest' | ||
TARGET_OS: windows | ||
runs-on: ${{ matrix.os }} | ||
name: "Builds binaries on ${{ matrix.os }}" | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: xmake-io/github-action-setup-xmake@v1 | ||
- name: Update git submodule | ||
run: | | ||
git submodule update --init | ||
- name: Restore xmake packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.xmake/.cache/packages | ||
key: ${{ runner.os }}-xmake-packages | ||
- name: Install tools | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update --fix-missing | ||
sudo apt-get install debhelper lcov valgrind -yy | ||
- name: Configure | ||
if: runner.os == 'Windows' | ||
run: xmake config -y -v -k ${{ env.TARGET_KIND }} -a ${{ env.TARGET_ARCH }} -m ${{ matrix.TARGET_MODE }} --ci-env=y | ||
- name: Configure for coverage mode | ||
if: runner.os == 'Linux' | ||
run: xmake config -y -v -k ${{ env.TARGET_KIND }} -a ${{ env.TARGET_ARCH }} -m coverage --ci-env=y | ||
- name: Build | ||
run: | | ||
xmake -w | ||
xmake build yutil_test | ||
xmake build pandagl_tests | ||
xmake build libcss_tests | ||
xmake build libui-router-tests | ||
xmake build libi18n-tests | ||
xmake build lcui_tests | ||
- name: Run PandaGL tests | ||
run: xmake run pandagl_tests | ||
- name: Run YUtil tests | ||
run: | | ||
xmake build yutil_test | ||
xmake run yutil_test ${{matrix.TEST_OPTIONS}} | ||
- name: Run LibCSS tests | ||
run: xmake run libcss_tests ${{matrix.TEST_OPTIONS}} | ||
- name: Run LibUIRouter tests | ||
run: xmake run libui-router-tests ${{matrix.TEST_OPTIONS}} | ||
- name: Run LibI18n tests | ||
run: xmake run libi18n-tests ${{matrix.TEST_OPTIONS}} | ||
- name: Run LCUI tests | ||
run: xmake run lcui_tests ${{matrix.TEST_OPTIONS}} | ||
- name: Upload reports to Codecov | ||
if: runner.os == 'Linux' | ||
run: bash <(curl -s https://codecov.io/bash); | ||
- name: Build for release | ||
run: | | ||
xmake config -y -v -k ${{ env.TARGET_KIND }} -a ${{ env.TARGET_ARCH }} -m ${{ matrix.TARGET_MODE }} | ||
xmake -w | ||
- name: Package | ||
run: | | ||
xmake package -v | ||
xmake install -o dist/lcui-package | ||
- name: Build examples | ||
continue-on-error: true | ||
run: | | ||
cd examples | ||
xmake -P . -v -y | ||
xmake install -P . -o ../dist/lcui-examples | ||
mv ../dist/lcui-examples/bin/* ../dist/lcui-examples/ | ||
rm -r ../dist/lcui-examples/bin | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: lcui${{ env.TARGET_MAJOR }}-${{ env.TARGET_VERSION }}-${{ env.TARGET_OS }}-${{ env.TARGET_KIND }} | ||
path: | | ||
dist/lcui-${{}} | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: lcui3-examples-${{ env.TARGET_OS }} | ||
path: | | ||
dist/lcui-examples | ||
- name: Cache xmake packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.xmake/.cache/packages | ||
key: ${{ runner.os }}-xmake-packages | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
env: | ||
ARTIFACT_DIR: ./release | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: ${{ env.ARTIFACT_DIR }} | ||
- name: Set release version | ||
run: python ./.github/scripts/get_release_version.py | ||
- name: Create release notes | ||
run: python ./.github/scripts/get_release_notes.py | ||
- name: Read package.json | ||
id: release_notes | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: RELEASE_NOTES.md | ||
trim: false | ||
- name: Create release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
body: ${{ steps.release_notes.outputs.content }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_name: LCUI ${{ env.REL_VERSION }} | ||
tag: ${{ github.ref }} | ||
file: ${{ env.ARTIFACT_DIR }}/* | ||
overwrite: true | ||
file_glob: true |