ekzhang / sshx

Fast, collaborative live terminal sharing over the web

Home Page:https://sshx.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deb/rpm packaging

hellt opened this issue · comments

Thanks you for this amazing solution/service; I can see a million use cases where I can get a good mileage out of it.

Installing binaries with curl | sh has a bad rep, although this is the easiest way to go and I use it for my project as well. But I would suggest looking at providing rpm/deb packages that can be uploaded to gemfury.com deb/apt repo for free.

Supply chain issue would rather demand having a non-curl-based installation option with a potential gpg signing of the repo and artifacts. This might be way ahead of time, since sshx has just been released, but I'd like to see it mature and look into alternative installation options.

Thanks again, you rock!

Thank you! I'll definitely take a look going forward. Thinking about packaging is a good problem to have out of the space of all problems; my biggest worry upon release was actually about my code, and that my software engineering wouldn't hold up to a lot of traffic :')

Of course deb/rpm would be top notch... But brew or similar would also be a nice step forward.

Hey @ekzhang I have already packed my own rust program, so maybe you can copy from me. I will paste the configuration here:

Cargo.toml

[package.metadata.deb]
copyright = "No Copyright"
maintainer-scripts = "scripts"
priority = "optional"
section = "misc"
extended-description = "<some description>"
license-file = "LICENSE"
name = "<binary name>"

Github Action I used:

  build_linux_x86:
    name: Linux x86_64
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          target: x86_64-unknown-linux-gnu
          override: true
      - uses: actions-rs/cargo@v1
        name: Build Release
        with:
          use-cross: true
          command: build
          args: --target x86_64-unknown-linux-gnu --release --all-features
      - uses: actions-rs/cargo@v1
        name: Build Debug
        with:
          use-cross: true
          command: build
          args: --target x86_64-unknown-linux-gnu --all-features
      - name: Rust Cargo Deb Package Build (amd64, Debian)
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          source $HOME/.cargo/env
          cargo install cargo-deb
          cargo deb --target=x86_64-unknown-linux-gnu
      - name: Copy binaries
        run: |
          mv target/x86_64-unknown-linux-gnu/release/würfeln ./wuerfeln
          mv target/x86_64-unknown-linux-gnu/debug/würfeln ./wuerfeln-debug
          mv target/x86_64-unknown-linux-gnu/debian/*.deb ./
      - uses: actions/upload-artifact@v2
        with:
          name: wuerfeln-x86_64-unknown-linux-gnu
          path: |
            wuerfeln
            wuerfeln-debug
            *.deb

I also have a postrm script which is in the scripts directory, you should take a look at that too. Although I think it's optional