-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nhnghia
committed
Mar 5, 2024
1 parent
486fe15
commit ead10c1
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: C/C++ CI | ||
|
||
on: | ||
push: | ||
tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Initialize variables | ||
env: | ||
GITHUB_REF: ${{ github.ref }} | ||
run: | | ||
cat <<EOF >> $GITHUB_ENV | ||
PACKAGE_VERSION=$(echo $GITHUB_REF | tr -d 'refs/tags/' ) | ||
EOF | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/montimage/linuxptp:${{ env.PACKAGE_VERSION }} | ||
ghcr.io/montimage/linuxptp:latest | ||
build-args: | | ||
LINUXPTP_VERSION=${{ env.PACKAGE_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ARG LINUXPTP_VERSION=v4.1 | ||
FROM ubuntu:22.04 AS builder | ||
|
||
RUN apt update && apt install -y git make gcc musl-dev | ||
|
||
WORKDIR /linuxptp-agent | ||
RUN git clone https://git.code.sf.net/p/linuxptp/code linuxptp && \ | ||
cd linuxptp && \ | ||
git checkout ${LINUXPTP_VERSION} && \ | ||
make | ||
|
||
FROM ubuntu:22.04 | ||
|
||
COPY --from=builder /linuxptp-agent/linuxptp/ptp4l /usr/local/bin/ | ||
COPY --from=builder /linuxptp-agent/linuxptp/phc2sys /usr/local/bin/ | ||
COPY --from=builder /linuxptp-agent/linuxptp/pmc /usr/local/bin/ | ||
|
||
RUN apt update && apt install -y musl-dev bc && \ | ||
apt clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
ldconfig |