Correctly restore build artifacts #29
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: JSON Schema | ||
on: | ||
push: | ||
branches: | ||
- main | ||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: false | ||
permissions: | ||
contents: write | ||
jobs: | ||
package: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- os: ubuntu-latest | ||
cc: clang | ||
cxx: clang++ | ||
shell: sh | ||
defaults: | ||
run: | ||
shell: ${{ matrix.platform.shell }} | ||
runs-on: ${{ matrix.platform.os }} | ||
env: | ||
CC: ${{ matrix.platform.cc }} | ||
CXX: ${{ matrix.platform.cxx }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: cmake --version | ||
- name: Configure JSON Schema | ||
run: > | ||
cmake -S . -B ./build | ||
-DCMAKE_BUILD_TYPE:STRING=Release | ||
-DJSONSCHEMA_TESTS:BOOL=ON | ||
-DJSONSCHEMA_TESTS_CI:BOOL=ON | ||
-DJSONSCHEMA_CONTINUOUS:BOOL=ON | ||
-DBUILD_SHARED_LIBS:BOOL=OFF | ||
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON | ||
- run: cmake --build ./build --config Release --parallel 4 | ||
- run: > | ||
cmake --install ./build --prefix ./build/dist --config Release --verbose | ||
--component intelligence_jsonschema | ||
# Not every CTest version supports the --test-dir option. If such option | ||
# is not recognized, `ctest` will successfully exit finding no tests. | ||
# Better to be sure and `cd` all the time here. | ||
- run: cd ./build && ctest --build-config Release --output-on-failure --parallel | ||
- run: cpack --config build/CPackConfig.cmake -B build/out -C Release | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts | ||
path: build/out/*.zip | ||
retention-days: 1 | ||
publish: | ||
needs: package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
path: build/out/ | ||
- run: tree build | ||
# TODO: Create a proper release if there is a tag instead | ||
- run: gh config set prompt disabled | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- run: gh release delete continuous --cleanup-tag --yes || true | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- run: gh release create continuous --prerelease --draft=false --title continuous --target "$GITHUB_SHA" --generate-notes | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- run: gh release upload --clobber continuous build/out/*.zip | ||
env: | ||
GH_TOKEN: ${{ github.token }} |