aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenil Dedania <dedaniahenil@gmail.com>2021-01-27 09:41:55 +0530
committerGitHub <noreply@github.com>2021-01-27 09:41:55 +0530
commitdf02e4e51c8b0fb1febc76ba423fed05f1d8d320 (patch)
treeb8ab9349085f435a1dd6c2984dd74758ec24a9ac
parentMerge pull request #154 from mosaic-org/add-alternative-buffer (diff)
parentAutomatically build release binaries (diff)
downloadsl0ppij-df02e4e51c8b0fb1febc76ba423fed05f1d8d320.tar.gz
sl0ppij-df02e4e51c8b0fb1febc76ba423fed05f1d8d320.tar.xz
sl0ppij-df02e4e51c8b0fb1febc76ba423fed05f1d8d320.zip
Merge pull request #153 from mosaic-org/ci-release-binaries
ci(release): Automatically build release binary on tag push
-rw-r--r--.github/workflows/release.yml99
1 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..012d17d3
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,99 @@
+name: Packaging
+
+on:
+ push:
+ tags:
+ - 'v*.*.*'
+
+jobs:
+ publish:
+ name: Publish on ${{ matrix.os }} for ${{ matrix.target }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ target:
+ - x86_64-unknown-linux-gnu
+ - x86_64-unknown-linux-musl
+ - x86_64-apple-darwin
+
+ include:
+ - os: ubuntu-18.04
+ target: x86_64-unknown-linux-gnu
+ client_artifact_name: target/x86_64-unknown-linux-gnu/release/mosaic
+ client_release_name: mosaic-x86_64-unknown-linux-gnu
+ strip: true
+
+ - os: ubuntu-18.04
+ target: x86_64-unknown-linux-musl
+ client_artifact_name: target/x86_64-unknown-linux-musl/release/mosaic
+ client_release_name: mosaic-x86_64-unknown-linux-musl
+ strip: true
+
+ - os: macos-latest
+ target: x86_64-apple-darwin
+ client_artifact_name: target/x86_64-apple-darwin/release/mosaic
+ client_release_name: mosaic-x86_64-macos-darwin
+ strip: true
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Setup Rust toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ target: ${{ matrix.target }}
+ override: true
+
+ - name: Install musl
+ if: matrix.target == 'x86_64-unknown-linux-musl'
+ run: |
+ sudo apt update
+ sudo apt install musl-tools -y
+
+ - name: cargo build
+ uses: actions-rs/cargo@v1
+ with:
+ command: build
+ args: --release --locked --target=${{ matrix.target }}
+
+
+ - name: Compress client
+ uses: svenstaro/upx-action@v2
+ with:
+ file: ${{ matrix.client_artifact_name }}
+ args: --lzma
+ strip: ${{ matrix.strip }}
+
+
+ # TODO?
+ # - name: Get CHANGELOG.md entry
+ # id: changelog_reader
+ # uses: mindsers/changelog-reader-action@v1.2.0
+ # with:
+ # path: ./CHANGELOG.md
+
+ - name: Upload client binaries to release
+ uses: svenstaro/upload-release-action@v2
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file: ${{ matrix.client_artifact_name }}
+ asset_name: ${{ matrix.client_release_name }}
+ tag: ${{ github.ref }}
+
+ deb-build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@master
+ - name: Deb Build
+ uses: ebbflow-io/cargo-deb-amd64-ubuntu@1.0
+
+ - name: Upload deb to release
+ uses: svenstaro/upload-release-action@v2
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file: target/x86_64-unknown-linux-musl/debian/mosaic*
+ asset_name: mosaic-amd64.deb
+ tag: ${{ github.ref }}
+ file_glob: true