Merge pull request #33 from ryancdotorg/ryancdotorg/non_str_funcs
[tomsfastmath.git] / .github / workflows / deploy.yml
blobe09b0f365c586fefed23b5eb0d48438c9f00e7f5
1 #############################################################################
2 #                                                                           #
3 #  Packagecloud deployment via GH actions for TomsFastMath                  #
4 #      (https://github.com/libtom/tomsfastmath.git)                         #
5 #                                                                           #
6 #############################################################################
8 name: Deploy
10 on:
11   workflow_dispatch
13 jobs:
14   deploy-to-packagecloud:
15     runs-on: ${{ matrix.os }}
16     strategy:
17       matrix:
18         os: [ ubuntu-20.04, ubuntu-22.04 ]
19     steps:
20       - uses: actions/checkout@v2
21       - name: set Ubuntu codename
22         run: |
23           echo "ubuntu_codename="$(lsb_release -sc) >> "$GITHUB_ENV"
24       - name: install dependencies
25         run: |
26           wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
27           echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${{ env.ubuntu_codename }} main" | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
28           sudo apt-get update -qq
29           sudo apt-get install -y cmake gcc
30       - name: build packages
31         run: |
32           mkdir -p build
33           cd build
34           cmake -DBUILD_SHARED_LIBS=Off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="/usr" ..
35           make -j$(nproc)
36           cpack -G DEB
37           cmake -DBUILD_SHARED_LIBS=On -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="/usr" ..
38           make -j$(nproc)
39           cpack -G DEB
40       - name: push deb packages to packagecloud.io
41         uses: computology/packagecloud-github-action@v0.6
42         with:
43           PACKAGE-NAME: build/packages/ubuntu/${{ env.ubuntu_codename }}/*.deb
44           PACKAGECLOUD-USERNAME: libtom
45           PACKAGECLOUD-REPONAME: packages
46           PACKAGECLOUD-DISTRO: ubuntu/${{ env.ubuntu_codename }}
47           PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}