From 8b04912063892b2115f5dcf342400e90cb39f2a6 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Sat, 12 Aug 2023 15:11:12 +0100 Subject: [PATCH] Initial commit --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ Containerfile | 19 +++++++++++++++ LICENSE.txt | 5 ++++ README.md | 11 +++++++++ 4 files changed, 86 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 Containerfile create mode 100644 LICENSE.txt create mode 100644 README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0917fb1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +--- +name: CI + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + +jobs: + container-image: + name: Build and push container image + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + + - name: Derive tags + run: | + echo 'tags<> $GITHUB_ENV + if [[ "${{ github.ref_type }}" == 'tag' ]]; then + echo "latest ${{ github.ref_name }} ${{ github.sha }}" >> $GITHUB_ENV + else + echo "${{ github.ref_name }} ${{ github.sha }}" >> $GITHUB_ENV + fi + echo 'EOF' >> $GITHUB_ENV + + - name: Build container image + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: esp-rs-distrobox + tags: "${{ env.tags }}" + containerfiles: Containerfile + oci: true + + - name: Push image to GHCR + if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }} + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: ghcr.io/dannixon + username: ${{ github.repository_owner }} + password: ${{ github.token }} + diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..9c7cf0e --- /dev/null +++ b/Containerfile @@ -0,0 +1,19 @@ +FROM ubuntu:22.04 + +RUN apt-get update && \ + apt-get install --yes \ + clang \ + curl \ + libxml2 \ + python3.10 \ + python3.10-venv \ + unzip + +RUN curl -L 'https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-unknown-linux-gnu' -o /usr/bin/espup && \ + chmod a+x /usr/bin/espup + +RUN curl -L 'https://github.com/esp-rs/embuild/releases/download/ldproxy-v0.3.2/ldproxy-x86_64-unknown-linux-gnu.zip' -o ldproxy.zip && \ + unzip ldproxy.zip ldproxy && \ + rm ldproxy.zip && \ + chmod a+x ldproxy && \ + mv ldproxy /usr/bin/ldproxy diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1f95d26 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,5 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..939b3c6 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# esp-rs-distrobox [![CI](https://github.com/DanNixon/esp-rs-distrobox/actions/workflows/ci.yml/badge.svg)](https://github.com/DanNixon/esp-rs-distrobox/actions/workflows/ci.yml) + +Container images containing [esp-rs](https://github.com/esp-rs) related tooling, intended for use with [Distrobox](https://github.com/89luca89/distrobox). + +Created as a result of much annoyance trying to get the ESP IDF to build in Nix and (to a much lesser extent) the fact that some tools were not yet packaged. + +Included is: + - clang + - Python + venv + - [espup](https://github.com/esp-rs/espup) + - [ldproxy](https://github.com/esp-rs/embuild/tree/master/ldproxy)