Skip to content

Commit a526b91

Browse files
Merge pull request #200 from fossillogic/main
Testing Docker archive system
2 parents 106ac21 + 4eec91c commit a526b91

File tree

4 files changed

+103
-12
lines changed

4 files changed

+103
-12
lines changed

.github/workflows/conan_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
python-version: "3.11"
2828

2929
- name: Cache pip
30-
uses: actions/cache@v3
30+
uses: actions/cache@v4
3131
with:
3232
path: ~/.cache/pip
3333
key: ${{ runner.os }}-pip
3434

3535
- name: Cache Conan
36-
uses: actions/cache@v3
36+
uses: actions/cache@v4
3737
with:
3838
path: ~/.conan
3939
key: ${{ runner.os }}-conan

.github/workflows/container_ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Archive CD
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v1.2.3
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: ubuntu:22.04 # Base container for building
13+
14+
env:
15+
PROJECT_NAME: fossil-test
16+
BUILD_DIR: builddir
17+
DIST_DIR: dist
18+
GHCR_IMAGE: ghcr.io/${{ github.repository_owner }}/fossil-test:latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Install dependencies
25+
run: |
26+
apt update
27+
apt install -y python3 python3-pip meson ninja-build build-essential curl docker.io git
28+
pip3 install --upgrade pip
29+
30+
- name: Set up Meson build
31+
run: |
32+
meson setup $BUILD_DIR
33+
34+
- name: Compile project
35+
run: meson compile -C $BUILD_DIR
36+
37+
- name: Generate source archives
38+
run: |
39+
meson dist -C $BUILD_DIR --formats xztar,bztar,gztar,zip
40+
mkdir -p $DIST_DIR
41+
cp $BUILD_DIR/meson-dist/* $DIST_DIR/
42+
43+
- name: List archives
44+
run: ls -l $DIST_DIR
45+
46+
- name: Build Docker image
47+
run: |
48+
# Dockerfile should be in repo root
49+
docker build -t $GHCR_IMAGE .
50+
51+
- name: Log in to GitHub Container Registry
52+
uses: docker/login-action@v2
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Push Docker image
59+
run: docker push $GHCR_IMAGE
60+
61+
- name: Upload artifacts
62+
uses: actions/upload-artifact@v3
63+
with:
64+
name: source-archives
65+
path: $DIST_DIR/

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Base image
2+
FROM ubuntu:22.04
3+
4+
# Install build dependencies
5+
RUN apt-get update && apt-get install -y \
6+
python3 python3-pip meson ninja-build build-essential git curl \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# Set workdir
10+
WORKDIR /app
11+
12+
# Copy source code
13+
COPY . /app
14+
15+
# Build project
16+
RUN meson setup builddir && meson compile -C builddir
17+
18+
# Copy dist archives into container
19+
RUN mkdir -p /dist && cp builddir/meson-dist/* /dist/
20+
21+
# Default command (optional)
22+
CMD ["bash"]

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,33 @@ To get started with Pizza Test, ensure you have the following installed:
5555

5656
### Adding Dependency
5757

58-
#### Adding via Meson WrapDB
58+
#### Adding via Meson Git Wrap
5959

60-
Meson can install packages directly from the WrapDB just like so, newest versions by default.
61-
62-
```bash
63-
meson wrap install fossil-test
64-
```
60+
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.
6561

6662
#### Adding via Conan GitHub repository
6763

68-
Conan can install packages directly from a GitHub repository if it contains a valid conanfile.py.
64+
Conan can install packages directly from a GitHub repository if it contains a valid `conanfile.py`.
6965

7066
```bash
7167
conan install git+https://github.com/fossillogic/fossil-test.git#v1.2.8 --name pizza_test --build=missing
7268
```
7369

7470
#### Integrate the Dependency:
75-
In your `meson.build` file, integrate Fossil Test by adding the following line:
7671

77-
```meson
78-
dep = dependency('fossil-test')
72+
Add the `fossil-test.wrap` file in your `subprojects` directory and include the following content:
73+
74+
```ini
75+
[wrap-git]
76+
url = https://github.com/fossillogic/fossil-test.git
77+
revision = v1.2.8
78+
79+
[provide]
80+
dependency_names = fossil-test, pizza-test
7981
```
8082

83+
In your `meson.build` file, integrate Fossil Test by adding the following line:
84+
8185
**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.
8286

8387
## Configure Build Options

0 commit comments

Comments
 (0)