Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
uZer committed Aug 28, 2024
1 parent 8d63576 commit 441120a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 20 deletions.
50 changes: 44 additions & 6 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:
cancel-in-progress: true

env:
# Will also push on dockerhub with DOCKERHUB_IMAGE_NAME
GHCR_IMAGE_NAME: ${{ github.repository }}

jobs:
Expand Down Expand Up @@ -89,25 +90,34 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

- name: Export digest
- name: Export artifact and digest
run: |
mkdir -p /tmp/digests
mkdir -p /tmp/artifact /tmp/digest
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
touch "/tmp/digest/${digest#sha256:}"
docker create ${digest#sha256:}
docker cp $(docker create ${{ env.DOCKER_METADATA_OUTPUT_TAGS }}@${digest}):/app/tg2 /tmp/artifact/tg2-${{ steps.vars.outputs.platform }}
- name: Upload digest
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
with:
name: digests-${{ steps.vars.outputs.platform }}
path: /tmp/digests/*
path: /tmp/digest/*
if-no-files-found: error
retention-days: 1

- name: Upload artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
with:
name: tg2-${{ steps.vars.outputs.platform }}
path: /tmp/artifact/*
if-no-files-found: error
retention-days: 1

- name: Inspect image
run: |
docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
create_multi_platform_manifest_and_push:
runs-on: ubuntu-24.04
permissions:
Expand All @@ -117,7 +127,7 @@ jobs:
id-token: write

needs:
- docker_build
- docker_build
steps:
- name: Download digests
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
Expand Down Expand Up @@ -209,3 +219,31 @@ jobs:
subject-name: index.docker.io/${{ vars.DOCKERHUB_IMAGE_NAME }}
subject-digest: ${{ steps.digest.outputs.digest }}
push-to-registry: true

create_release:
runs-on: ubuntu-latest
permissions:
packages: read
contents: write
id-token: write
needs:
- docker_build
- create_multi_platform_manifest_and_push
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
path: /tmp/artifacts
pattern: tg2-*
merge-multiple: true

- name: Create release
uses: softprops/action-gh-release@v2
with:
files: /tmp/artifacts/tg2*
fail_on_unmatched_files: true
make_latest: true
generate_release_notes: true
29 changes: 15 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ ENV NTP_ARCHIVE=https://downloads.nwtime.org/ntp/4.2.8/${NTP_VERSION}.tar.gz

WORKDIR /tmp

RUN set -x \
&& apt update \
&& apt install -y build-essential wget

RUN set -x \
&& wget "${NTP_ARCHIVE}" \
&& tar xvzf "${NTP_VERSION}.tar.gz" \
&& mv "${NTP_VERSION}" ntp \
&& cd ntp \
&& ./configure --without-crypto \
&& make \
&& cd util \
&& make tg2 \
&& chmod +x tg2
# RUN set -x \
# && apt update \
# && apt install -y build-essential wget
#
# RUN set -x \
# && wget "${NTP_ARCHIVE}" \
# && tar xvzf "${NTP_VERSION}.tar.gz" \
# && mv "${NTP_VERSION}" ntp \
# && cd ntp \
# && ./configure --without-crypto \
# && make \
# && cd util \
# && make tg2 \
# && chmod +x tg2
RUN mkdir -p /tmp/ntp/util/ && echo $(uname -m) > /tmp/ntp/util/tg2

FROM debian:stable-slim@sha256:382967fd7c35a0899ca3146b0b73d0791478fba2f71020c7aa8c27e3a4f26672

Expand Down

0 comments on commit 441120a

Please sign in to comment.