Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deb/rpm packaging #35

Open
hellt opened this issue Nov 7, 2023 · 3 comments
Open

deb/rpm packaging #35

hellt opened this issue Nov 7, 2023 · 3 comments

Comments

@hellt
Copy link

hellt commented Nov 7, 2023

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!

@ekzhang
Copy link
Owner

ekzhang commented Nov 7, 2023

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 :')

@silopolis
Copy link

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

@FairyTail2000
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants