summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-08-25 13:07:54 +0200
committerManuel Bentele2021-08-25 13:41:37 +0200
commit3c950c6fcc25f13fee3f43f72e4b61435c78f8fb (patch)
tree6d2764b61c0de599918bb97ae8c3d8ea4c62d21b
parent[BUILD] Fix CMake output if kernel module is turned off on Linux system (diff)
downloaddnbd3-3c950c6fcc25f13fee3f43f72e4b61435c78f8fb.tar.gz
dnbd3-3c950c6fcc25f13fee3f43f72e4b61435c78f8fb.tar.xz
dnbd3-3c950c6fcc25f13fee3f43f72e4b61435c78f8fb.zip
[BUILD] Add Github action to publish packages for releases
-rw-r--r--.github/workflows/build-kernel-module.yml1
-rw-r--r--.github/workflows/build-programs.yml1
-rw-r--r--.github/workflows/lint.yml1
-rw-r--r--.github/workflows/release.yml63
4 files changed, 63 insertions, 3 deletions
diff --git a/.github/workflows/build-kernel-module.yml b/.github/workflows/build-kernel-module.yml
index c2c8978..437f346 100644
--- a/.github/workflows/build-kernel-module.yml
+++ b/.github/workflows/build-kernel-module.yml
@@ -5,7 +5,6 @@ on:
branches:
- master
pull_request:
- release:
jobs:
build:
diff --git a/.github/workflows/build-programs.yml b/.github/workflows/build-programs.yml
index a38cafb..2ca3e50 100644
--- a/.github/workflows/build-programs.yml
+++ b/.github/workflows/build-programs.yml
@@ -5,7 +5,6 @@ on:
branches:
- master
pull_request:
- release:
jobs:
build:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 99195d9..779865b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -5,7 +5,6 @@ on:
branches:
- master
pull_request:
- release:
jobs:
lint:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..6356a45
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,63 @@
+name: Release dnbd3
+
+on:
+ release:
+ types: [published]
+
+jobs:
+ release:
+ name: Release dnbd3
+ runs-on: ubuntu-20.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@v2
+ - 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 }}