From c108b7f0bb882edb6228eb913f7b2c91e7832e0f Mon Sep 17 00:00:00 2001
From: Robin Appelman <robin@icewind.nl>
Date: Tue, 13 Apr 2021 13:53:05 +0200
Subject: [PATCH] release packaging with ci

Signed-off-by: Robin Appelman <robin@icewind.nl>
---
 .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5d34225..42d3396 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -4,6 +4,8 @@ on:
   release:
     types: [created]
 
+env:
+  APP_NAME: notify_push
 
 jobs:
   release-binaries:
@@ -37,3 +39,36 @@ jobs:
           file: target/${{ matrix.target }}/release/notify_push
           asset_name: notify_push-${{ matrix.target }}
           tag: ${{ github.ref }}
+
+  package:
+    name: Package release
+    runs-on: ubuntu-20.04
+    steps:
+      - name: musl-tools
+        run: |
+          sudo apt-get install musl-tools
+      - name: Checkout code
+        uses: actions/checkout@v2
+      - uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+          target: x86_64-unknown-linux-musl
+      - name: cross
+        run: |
+          cargo install cross
+      - name: Setup krankler
+        run: |
+          wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl
+          chmod +x krankerl
+      - name: Package app
+        run: |
+          ./krankerl package
+      - name: Upload binary to release
+        uses: svenstaro/upload-release-action@v2
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          file: build/artifacts/${{ env.APP_NAME }}.tar.gz
+          asset_name: ${{ env.APP_NAME }}.tar.gz
+          tag: ${{ github.ref }}
\ No newline at end of file
-- 
GitLab