taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
227 stars 19 forks source link

how to compile under centos #45

Closed muziling closed 1 year ago

muziling commented 1 year ago

user follow yml

  upload-assets:
    runs-on: ubuntu-latest
    container: centos:7
    steps:
      - uses: actions/checkout@v3

      - name: Initialization environment
        run: |
          yum install -y libpcap-devel

      - uses: taiki-e/upload-rust-binary-action@v1
        with:
          # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
          # Note that glob pattern is not supported yet.
          bin: mytest
          # (required) GitHub token for uploading assets to GitHub Releases.
          token: ${{ secrets.GITHUB_TOKEN }}

github action got error

Run bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
/__w/_actions/taiki-e/upload-rust-binary-action/v1/main.sh: line 120: rustc: command not found
taiki-e commented 1 year ago

As documented, you have to install rustc.

Compatibility

This action has been tested for GitHub-hosted runners (Ubuntu, macOS, Windows). To use this action in self-hosted runners or in containers, at least the following tools are required:

  • rustup, cargo, rustc
  • bash, GNU Coreutils, GNU grep, GNU tar
  • gh (GitHub CLI)
  • zip (only Unix-like)
  • 7z (only Windows)

This is an example of installing rustc to a CentOS container: https://github.com/taiki-e/install-action/blob/1e2c8412acfc7caab88b3c94fa7549a15d9734ef/.github/workflows/ci.yml#L146-L150 For GitHub CLI, see https://github.com/cli/cli/blob/trunk/docs/install_linux.md#fedora-centos-red-hat-enterprise-linux-dnf.