From 618ebca9fe1319000e3a6a1ba23dfc71905f7143 Mon Sep 17 00:00:00 2001 From: Miguel Aranha Baldi Horlle Date: Fri, 5 Apr 2024 19:53:16 -0300 Subject: [PATCH] Fedora 38 base image for AppImage - Rust 1.77.0 - AppImage kit 13 - Gtk4: libadwaita, gtksourceview5 --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++ .../workflows/build-push-tagged-appimage.yml | 66 +++++++++++++++++++ appimage/Dockerfile | 34 ++++++++++ 4 files changed, 158 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/build-push-tagged-appimage.yml create mode 100644 appimage/Dockerfile diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..272cbd7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..24473de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/workflows/build-push-tagged-appimage.yml b/.github/workflows/build-push-tagged-appimage.yml new file mode 100644 index 0000000..9935dfc --- /dev/null +++ b/.github/workflows/build-push-tagged-appimage.yml @@ -0,0 +1,66 @@ +name: build-push-tagged-appimage + +on: + push: + tags: + - '*.*.*' + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + # TO get the tag name + - name: Get the tag name + run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + - name: Checkout repository + uses: actions/checkout@v2 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/miguelbaldi/relm4-docker + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + flavor: | + latest=auto + suffix=-appimage,onlatest=true + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: appimage + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/appimage/Dockerfile b/appimage/Dockerfile new file mode 100644 index 0000000..533cd63 --- /dev/null +++ b/appimage/Dockerfile @@ -0,0 +1,34 @@ +FROM fedora:38 +ARG RUST_VERSION=1.77.0 +ENV RUST_VERSION=$RUST_VERSION + +#RUN dnf groupinstall "C Development Tools and Libraries" -y +RUN dnf install gcc-c++ libgsasl-devel cmake gtk4-devel libadwaita-devel gtksourceview5-devel -y + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +RUN . ~/.cargo/env +RUN ls $HOME/.cargo/env +ENV PATH=/root/.cargo/bin:$PATH +RUN rustup install ${RUST_VERSION} + + +ENV APPIMAGE_VERSION=13 +ENV APPIMAGE_EXTRACT_AND_RUN=1 + +RUN cargo install cargo-appimage + +RUN dnf install wget -y + +RUN wget https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGE_VERSION/appimagetool-x86_64.AppImage +RUN chmod a+x appimagetool-x86_64.AppImage +RUN dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of=appimagetool-x86_64.AppImage +RUN ls -lsha +RUN ./appimagetool-x86_64.AppImage --appimage-extract +RUN ls +RUN ln -nfs /squashfs-root/usr/bin/appimagetool /usr/bin/appimagetool + +RUN dnf install file desktop-file-utils appstream -y + +WORKDIR /mnt + +CMD ["/bin/bash"] \ No newline at end of file