|
1 | 1 | name: ci |
2 | 2 | env: |
3 | | - CMAKE_GENERATOR: Ninja |
| 3 | + HOMEBREW_NO_INSTALL_CLEANUP: 1 |
| 4 | + CMAKE_GENERATOR: Ninja |
4 | 5 |
|
5 | 6 | on: |
6 | 7 | push: |
|
9 | 10 | - "**.cmake" |
10 | 11 | - "**.f90" |
11 | 12 | - ".github/workflows/ci.yml" |
| 13 | + release: |
| 14 | + types: [published] |
| 15 | + |
12 | 16 |
|
13 | 17 | jobs: |
14 | 18 |
|
|
33 | 37 | - run: ctest --parallel 2 --output-on-failure |
34 | 38 | working-directory: Examples/build |
35 | 39 |
|
| 40 | + - name: create package |
| 41 | + run: cpack --config build/CPackConfig.cmake |
| 42 | + |
| 43 | + - name: Upload artifact |
| 44 | + uses: actions/upload-artifact@v1 |
| 45 | + with: |
| 46 | + name: binary-archive |
| 47 | + path: build/package |
| 48 | + |
| 49 | + - name: get version |
| 50 | + id: get_version |
| 51 | + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} |
| 52 | + |
| 53 | + - name: Upload release asset |
| 54 | + if: github.event.action == 'published' |
| 55 | + uses: actions/upload-release-asset@v1 |
| 56 | + env: |
| 57 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + with: |
| 59 | + upload_url: ${{ github.event.release.upload_url }} |
| 60 | + asset_path: build/package/h5fortran-${{ steps.get_version.outputs.VERSION }}-Linux.zip |
| 61 | + asset_name: h5fortran-${{ steps.get_version.outputs.VERSION }}-Linux.zip |
| 62 | + asset_content_type: application/zip |
| 63 | + |
| 64 | + |
36 | 65 |
|
37 | 66 | mac: |
38 | 67 | needs: linux |
|
52 | 81 | - run: cmake --build Examples/build --parallel |
53 | 82 | - run: ctest --parallel 2 --output-on-failure |
54 | 83 | working-directory: Examples/build |
| 84 | + |
| 85 | + - name: create package |
| 86 | + run: cpack --config build/CPackConfig.cmake |
| 87 | + |
| 88 | + - name: Upload artifact |
| 89 | + uses: actions/upload-artifact@v1 |
| 90 | + with: |
| 91 | + name: binary-archive |
| 92 | + path: build/package |
| 93 | + |
| 94 | + - name: get version |
| 95 | + id: get_version |
| 96 | + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} |
| 97 | + |
| 98 | + - name: Upload release asset |
| 99 | + if: github.event.action == 'published' |
| 100 | + uses: actions/upload-release-asset@v1 |
| 101 | + env: |
| 102 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 103 | + with: |
| 104 | + upload_url: ${{ github.event.release.upload_url }} |
| 105 | + asset_path: build/package/h5fortran-${{ steps.get_version.outputs.VERSION }}-Darwin.zip |
| 106 | + asset_name: h5fortran-${{ steps.get_version.outputs.VERSION }}-Darwin.zip |
| 107 | + asset_content_type: application/zip |
0 commit comments