summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: 6a06173384265f68acd09e89e6a619773dcfc8d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Release dnbd3

on:
  release:
    types: [published]

jobs:
  release:
    name: Release dnbd3
    # Use very old system (= libc) for building for best compatibility
    runs-on: ubuntu-18.04
    steps:
      - name: Install dnbd3 dependencies
        run: |
          sudo apt-get update -y -qq
          sudo apt-get install -y -qq make \
                                      clang-format \
                                      linux-headers-generic \
                                      libfuse-dev \
                                      libjansson-dev \
                                      rpm
      - name: Checkout dnbd3 repository
        uses: actions/checkout@v4
      - name: Fetch dnbd3 repository tags
        run: git fetch --prune --unshallow
      - name: Configure dnbd3 release
        run: |
          cmake -B ${{ github.workspace }}/build \
                -S ${{ github.workspace }} \
                -D CMAKE_BUILD_TYPE=Release \
                -D DNBD3_KERNEL_MODULE=OFF \
                -D DNBD3_BENCHMARK=OFF \
                -D DNBD3_SERVER_FUSE=OFF \
                -D DNBD3_RELEASE_HARDEN=OFF
      - name: Build dnbd3 artifacts
        working-directory: ${{ github.workspace }}/build
        run: make package
      - name: Create links to artifacts
        working-directory: ${{ github.workspace }}/build
        run: |
          ln -s dnbd3_*.deb    dnbd3_linux_x86_64.deb
          ln -s dnbd3_*.rpm    dnbd3_linux_x86_64.rpm
          ln -s dnbd3_*.tar.gz dnbd3_linux_x86_64.tar.gz
      - name: Attach Debian artifacts to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ${{ github.workspace }}/build/dnbd3_linux_x86_64.deb
          asset_name: dnbd3_linux_x86_64.deb
          tag: ${{ github.ref }}
      - name: Attach RedHat artifacts to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ${{ github.workspace }}/build/dnbd3_linux_x86_64.rpm
          asset_name: dnbd3_linux_x86_64.rpm
          tag: ${{ github.ref }}
      - name: Attach generic artifacts to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ${{ github.workspace }}/build/dnbd3_linux_x86_64.tar.gz
          asset_name: dnbd3_linux_x86_64.tar.gz
          tag: ${{ github.ref }}