diff --git a/.github/workflows/conan_ci.yml b/.github/workflows/conan_ci.yml index a63440b..9799bdc 100644 --- a/.github/workflows/conan_ci.yml +++ b/.github/workflows/conan_ci.yml @@ -27,13 +27,13 @@ jobs: python-version: "3.11" - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip - name: Cache Conan - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.conan key: ${{ runner.os }}-conan diff --git a/.github/workflows/container_ci.yml b/.github/workflows/container_ci.yml new file mode 100644 index 0000000..7a81647 --- /dev/null +++ b/.github/workflows/container_ci.yml @@ -0,0 +1,65 @@ +name: Archive CD + +on: + push: + tags: + - 'v*' # Trigger on version tags like v1.2.3 + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:22.04 # Base container for building + + env: + PROJECT_NAME: fossil-test + BUILD_DIR: builddir + DIST_DIR: dist + GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/fossil-test:latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install dependencies + run: | + apt update + apt install -y python3 python3-pip meson ninja-build build-essential curl docker.io git + pip3 install --upgrade pip + + - name: Set up Meson build + run: | + meson setup $BUILD_DIR + + - name: Compile project + run: meson compile -C $BUILD_DIR + + - name: Generate source archives + run: | + meson dist -C $BUILD_DIR --formats xztar,bztar,gztar,zip + mkdir -p $DIST_DIR + cp $BUILD_DIR/meson-dist/* $DIST_DIR/ + + - name: List archives + run: ls -l $DIST_DIR + + - name: Build Docker image + run: | + # Dockerfile should be in repo root + docker build -t $GHCR_IMAGE . + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Docker image + run: docker push $GHCR_IMAGE + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: source-archives + path: $DIST_DIR/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..42c61e4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Base image +FROM ubuntu:22.04 + +# Install build dependencies +RUN apt-get update && apt-get install -y \ + python3 python3-pip meson ninja-build build-essential git curl \ + && rm -rf /var/lib/apt/lists/* + +# Set workdir +WORKDIR /app + +# Copy source code +COPY . /app + +# Build project +RUN meson setup builddir && meson compile -C builddir + +# Copy dist archives into container +RUN mkdir -p /dist && cp builddir/meson-dist/* /dist/ + +# Default command (optional) +CMD ["bash"] diff --git a/README.md b/README.md index da7cbf2..cfff9b6 100644 --- a/README.md +++ b/README.md @@ -55,29 +55,33 @@ To get started with Pizza Test, ensure you have the following installed: ### Adding Dependency -#### Adding via Meson WrapDB +#### Adding via Meson Git Wrap -Meson can install packages directly from the WrapDB just like so, newest versions by default. - -```bash -meson wrap install fossil-test -``` +To add a git-wrap, place a `.wrap` file in `subprojects` with the Git repo URL and revision, then use `dependency('fossil-test')` in `meson.build` so Meson can fetch and build it automatically. #### Adding via Conan GitHub repository -Conan can install packages directly from a GitHub repository if it contains a valid conanfile.py. +Conan can install packages directly from a GitHub repository if it contains a valid `conanfile.py`. ```bash conan install git+https://github.com/fossillogic/fossil-test.git#v1.2.8 --name pizza_test --build=missing ``` #### Integrate the Dependency: - In your `meson.build` file, integrate Fossil Test by adding the following line: -```meson -dep = dependency('fossil-test') +Add the `fossil-test.wrap` file in your `subprojects` directory and include the following content: + +```ini +[wrap-git] +url = https://github.com/fossillogic/fossil-test.git +revision = v1.2.8 + +[provide] +dependency_names = fossil-test, pizza-test ``` +In your `meson.build` file, integrate Fossil Test by adding the following line: + **Note**: For the best experience, always use the latest release of Pizza Test. Visit the [Pizza Test Releases](https://github.com/fossillogic/fossil-test/releases) page for the latest versions. ## Configure Build Options