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 1ae2d4d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 20 deletions.
59 changes: 53 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 @@ -88,26 +89,36 @@ jobs:
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
outputs: type=registry,type=local,dest=/tmp/docker_content

- name: Export digest
- name: Export artifact and digest
run: |
mkdir -p /tmp/digests
mkdir -p /tmp/docker_content /tmp/digest
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
touch "/tmp/digest/${digest#sha256:}"
find /tmp/docker_content/app
cp /tmp/docker_content/app/tg2* /tmp/artifacts/tg2-${{ env.DOCKER_METADATA_OUTPUT_VERSION }}
- 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/artifacts/*
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 +128,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 +220,39 @@ jobs:
subject-name: index.docker.io/${{ vars.DOCKERHUB_IMAGE_NAME }}
subject-digest: ${{ steps.digest.outputs.digest }}
push-to-registry: true

create_github_multiplatform_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: Tag the repository
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: release-

- 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
tag_name: ${{ steps.tag.outputs.new_tag }}
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 1ae2d4d

Please sign in to comment.