From b6e79d20348cc06e4d6958df987d3f98a6e2ccbd Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Fri, 8 Jul 2022 21:48:59 -0400 Subject: [PATCH 1/2] ENH: Attach binaries to releases --- .github/workflows/release-binaries.yml | 93 ++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/release-binaries.yml diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml new file mode 100644 index 000000000..49e907f1d --- /dev/null +++ b/.github/workflows/release-binaries.yml @@ -0,0 +1,93 @@ +# Workflow adapted from https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60 +name: CMake Build Matrix + +# Controls when the action will run. Triggers the workflow on push +on: + release: + types: [created] + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Ubuntu_20.04-GCC", + os: ubuntu-20.04, + artifact: "ubuntu-20.04-gcc.zip", + build_type: "Release", + cc: "gcc", + cxx: "g++", + generators: "Ninja" + } + - { + name: "macos-11-clang", + os: macos-11, + artifact: "macos-11-clang.zip", + build_type: "Release", + cc: "clang", + cxx: "clang++", + generators: "Ninja" + } + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + - name: Print env + run: | + echo github.event.action: ${{ github.event.action }} + echo github.event_name: ${{ github.event_name }} + - name: Install dependencies on ubuntu + if: startsWith(matrix.config.name, 'Ubuntu_20.04-GCC') + run: | + sudo apt-get update + sudo apt-get install ninja-build cmake + ninja --version + cmake --version + gcc --version + - name: Install dependencies on macos + if: startsWith(matrix.config.os, 'macos-11') + run: | + brew install cmake ninja + ninja --version + cmake --version + - name: Configure + shell: bash + run: | + mkdir ../build + cd ../build + cmake \ + -S ../ANTs \ + -B . \ + -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ + -G "${{ matrix.config.generators }}" \ + -DCMAKE_INSTALL_PREFIX:PATH=../install/ants-${{ github.ref_name }} + - name: Build + shell: bash + run: | + cd ../build + cmake --build . --config ${{ matrix.config.build_type }} --parallel + - name: Install + shell: bash + run: | + cd ../build/ANTS-build + cmake --install . + - name: Pack + shell: bash + run: | + cd ../build/install + zip -r ../../ants-${{ github.ref_name }}-${{ matrix.config.artifact }} . + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ../ants-${{ github.ref_name }}-${{ matrix.config.artifact }} + asset_name: ants-${{ github.ref_name }}-${{ matrix.config.artifact }} + asset_content_type: application/zip From c84738e464eeec3e7e4eeeb9ba6909638a6c1276 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Sat, 9 Jul 2022 14:18:40 -0400 Subject: [PATCH 2/2] ENH: Add Ubuntu 18.04 --- .github/workflows/release-binaries.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 49e907f1d..d61b9d20c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -4,7 +4,7 @@ name: CMake Build Matrix # Controls when the action will run. Triggers the workflow on push on: release: - types: [created] + types: [created, edited] jobs: build: @@ -23,6 +23,15 @@ jobs: cxx: "g++", generators: "Ninja" } + - { + name: "Ubuntu_18.04-GCC", + os: ubuntu-18.04, + artifact: "ubuntu-18.04-gcc.zip", + build_type: "Release", + cc: "gcc", + cxx: "g++", + generators: "Ninja" + } - { name: "macos-11-clang", os: macos-11, @@ -43,7 +52,7 @@ jobs: echo github.event.action: ${{ github.event.action }} echo github.event_name: ${{ github.event_name }} - name: Install dependencies on ubuntu - if: startsWith(matrix.config.name, 'Ubuntu_20.04-GCC') + if: startsWith(matrix.config.name, 'Ubuntu_') run: | sudo apt-get update sudo apt-get install ninja-build cmake @@ -90,4 +99,4 @@ jobs: upload_url: ${{ github.event.release.upload_url }} asset_path: ../ants-${{ github.ref_name }}-${{ matrix.config.artifact }} asset_name: ants-${{ github.ref_name }}-${{ matrix.config.artifact }} - asset_content_type: application/zip + asset_content_type: application/zip \ No newline at end of file