From da92e5e54fc839e4a51e897c7799aea099c90f98 Mon Sep 17 00:00:00 2001 From: Thomas Harrison Date: Sat, 8 Jul 2023 14:25:25 -0400 Subject: [PATCH] Create ci.yml --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..743c6b4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CMake + +on: + push: + branches: [ "master" ] + tags: ["*"] + pull_request: + branches: [ "master" ] + +env: + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} + continue-on-error: true + + - name: Build Install + run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/install + + - name: Archive Install + working-directory: ${{github.workspace}}/install + run: tar -czf ${{github.workspace}}/output/glpp.tar.gz * + + - name: Create Release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ github.ref }} + tag_name: ${{ github.ref }} + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Upload installer + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{github.workspace}}/output/glpp.tar.gz + asset_name: glpp_${{ github.ref_name }}.tar.gz + asset_content_type: application/gzip