|
1 | 1 | name: build
|
2 | 2 | on: push
|
3 | 3 | jobs:
|
4 |
| - build-ubuntu: |
| 4 | + build-ubuntu-meson: |
5 | 5 | runs-on: ubuntu-latest
|
6 | 6 | steps:
|
7 | 7 | - name: install meson
|
|
13 | 13 | run: meson example/build example && ninja -C example/build
|
14 | 14 | - uses: actions/upload-artifact@v2
|
15 | 15 | with:
|
16 |
| - name: ubuntu |
| 16 | + name: ubuntu-meson |
17 | 17 | path: |
|
18 | 18 | build/
|
19 |
| - example/build/ |
| 19 | + example/build/ build-ubuntu: |
| 20 | + build-ubuntu-cmake: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: install ninja-build |
| 24 | + run: sudo apt update -y && sudo apt install -y ninja-build |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - name: compile library |
| 27 | + run: cmake -S . -B build && cmake --build build |
| 28 | + - uses: actions/upload-artifact@v2 |
| 29 | + with: |
| 30 | + name: ubuntu-cmake |
| 31 | + path: | |
| 32 | + build/ |
| 33 | + collect-and-release: |
| 34 | + needs: [build-ubuntu-meson, build-ubuntu-cmake] |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v2 |
| 38 | + - name: Download artifact ubuntu-meson |
| 39 | + uses: actions/download-artifact@v3 |
| 40 | + with: |
| 41 | + name: ubuntu-meson |
| 42 | + path: ./build-ubuntu-meson |
| 43 | + - name: Download artifact ubuntu-cmake |
| 44 | + uses: actions/download-artifact@v3 |
| 45 | + with: |
| 46 | + name: ubuntu-cmake |
| 47 | + path: ./build-ubuntu-cmake |
| 48 | + |
| 49 | + - name: 'Compress files for the linux-x64 release artifact' |
| 50 | + shell: bash |
| 51 | + run: | |
| 52 | + zip --junk-paths ./linux-x64.zip ./build-ubuntu-cmake/**/*.so ./build-ubuntu-cmake/**/*.so.* ./build-ubuntu-meson/build/adstool |
| 53 | +
|
| 54 | + - name: 'Obtain the current version number from the debian changelog. We need it to create the release.' |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + echo "GITHUB_ADSLIB_VERSION_NUMBER=$(dpkg-parsechangelog -SVersion --file ./debian/changelog)" >> $GITHUB_ENV |
| 58 | + - name: Create release |
| 59 | + if: startsWith(github.ref, 'refs/tags/v') |
| 60 | + id: create_release |
| 61 | + uses: actions/create-release@v1 |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + tag_name: ${{ env.GITHUB_ADSLIB_VERSION_NUMBER }} |
| 66 | + release_name: ${{ env.GITHUB_ADSLIB_VERSION_NUMBER }} |
| 67 | + generate_release_notes: true |
| 68 | + - name: 'Upload release asset' |
| 69 | + if: steps.create_release.outcome == 'success' |
| 70 | + uses: actions/upload-release-asset@v1 |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + with: |
| 74 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 75 | + asset_path: ./linux-x64.zip |
| 76 | + asset_name: linux-x64.zip |
| 77 | + asset_content_type: application/zip |
0 commit comments