Skip to content

Commit

Permalink
[2.8] Release artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jan 19, 2022
1 parent 1840415 commit 6241e09
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -47,6 +47,22 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build artifacts
uses: docker/bake-action@v1
with:
targets: artifact-all
-
name: Move artifacts
run: |
mv ./bin/**/* ./bin/
-
name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: registry
path: ./bin/*
if-no-files-found: error
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand All @@ -63,3 +79,15 @@ jobs:
${{ steps.meta.outputs.bake-file }}
targets: image-all
push: ${{ startsWith(github.ref, 'refs/tags/') }}
-
name: GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
bin/*.tar.gz
bin/*.zip
bin/*.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions Dockerfile
Expand Up @@ -28,6 +28,11 @@ RUN --mount=type=bind,rw \
--files="LICENSE" \
--files="README.md"

FROM scratch AS artifacts
COPY --from=build /out/*.tar.gz /
COPY --from=build /out/*.zip /
COPY --from=build /out/*.sha256 /

FROM scratch AS binary
COPY --from=build /usr/local/bin/registry* /

Expand Down
17 changes: 17 additions & 0 deletions docker-bake.hcl
Expand Up @@ -12,6 +12,23 @@ target "binary" {
output = ["./bin"]
}

target "artifact" {
target = "artifacts"
output = ["./bin"]
}

target "artifact-all" {
inherits = ["artifact"]
platforms = [
"linux/amd64",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64",
"linux/ppc64le",
"linux/s390x"
]
}

target "image" {
inherits = ["docker-metadata-action"]
}
Expand Down

0 comments on commit 6241e09

Please sign in to comment.