Store the last message if no clients are connected #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daemon Build | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build daemon | |
run: cargo build --release | |
working-directory: daemon | |
- name: Build CLI | |
run: cargo build --release | |
working-directory: cli | |
- name: Package binaries | |
run: | | |
Move-Item -Path target\release\mysti-daemon.exe -Destination mysti-daemon.exe | |
Move-Item -Path target\release\mysti.exe -Destination mysti.exe | |
Compress-Archive -Path mysti-daemon.exe, mysti.exe -DestinationPath mysti-windows.zip | |
shell: powershell | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mysti-windows | |
path: ./mysti-windows.zip | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install additional packages | |
run: sudo apt-get install -y libx11-dev xfonts-base xcb libx11-xcb-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-xfixes0-dev | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build daemon | |
run: cargo build --release | |
working-directory: daemon | |
- name: Build CLI | |
run: cargo build --release | |
working-directory: cli | |
- name: Package binaries | |
run: | | |
mv target/release/mysti-daemon mysti-daemon | |
mv target/release/mysti mysti | |
tar -czvf mysti-ubuntu.tar.gz mysti-daemon mysti | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mysti-ubuntu | |
path: ./mysti-ubuntu.tar.gz | |
build-fedora: | |
runs-on: ubuntu-latest | |
container: | |
image: fedora:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install additional packages | |
run: dnf install -y libX11-devel xorg-x11-fonts-misc xorg-x11-font-utils make automake gcc gcc-c++ kernel-devel | |
- name: Install Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
- name: Build daemon | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: daemon | |
- name: Build CLI | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: cli | |
- name: Package binaries | |
run: | | |
find . -type f -name mysti-daemon -exec mv {} mysti-daemon \; | |
find . -type f -name mysti -exec mv {} mysti \; | |
tar -czvf mysti-fedora.tar.gz mysti-daemon mysti | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mysti-fedora | |
path: ./mysti-fedora.tar.gz | |
build-debian: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install additional packages | |
run: | | |
apt-get update && apt-get install -y curl libx11-dev xfonts-base xfonts-utils make automake gcc g++ \ | |
linux-headers-amd64 pkg-config openssl libssl-dev mlocate libxcb-render0 libxcb-render0-dev \ | |
libxcb-shape0 libxcb-shape0-dev libxcb-xfixes0 libxcb-xfixes0-dev | |
- name: Install Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
shell: bash | |
- name: Build daemon | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: daemon | |
shell: bash | |
- name: Build CLI | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: cli | |
shell: bash | |
- name: Package binaries | |
run: | | |
find . -type f -name mysti-daemon -exec mv {} mysti-daemon \; | |
find . -type f -name mysti -exec mv {} mysti \; | |
tar -czvf mysti-debian.tar.gz mysti-daemon mysti | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mysti-debian | |
path: ./mysti-debian.tar.gz | |
build-archlinux: | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install additional packages | |
run: pacman -Syu --noconfirm libx11 xorg-fonts-misc xorg-mkfontscale make automake gcc linux-headers pkg-config | |
- name: Install Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
- name: Build daemon | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: daemon | |
- name: Build CLI | |
run: source $HOME/.cargo/env && cargo build --release | |
working-directory: cli | |
- name: Package binaries | |
run: | | |
find . -type f -name mysti-daemon -exec mv {} mysti-daemon \; | |
find . -type f -name mysti -exec mv {} mysti \; | |
tar -czvf mysti-archlinux.tar.gz mysti-daemon mysti | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mysti-archlinux | |
path: ./mysti-archlinux.tar.gz | |
release: | |
needs: [build-windows, build-ubuntu, build-fedora, build-debian, build-archlinux] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
- name: Generate tag name | |
run: echo "TAG_NAME=$(date +%F-%H-%M)" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
mysti-*/mysti-* | |
name: Daemon and CLI download | |
tag_name: ${{ env.TAG_NAME }} | |
body: | | |
This is the latest release of the Mysti daemon and CLI. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Delete older releases | |
uses: dev-drprasad/delete-older-releases@v0.3.2 | |
with: | |
keep_latest: 1 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |