[2.8] Release artifacts

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-01-19 16:54:25 +01:00
parent 1840415ca8
commit 6241e099e1
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 50 additions and 0 deletions

View file

@ -47,6 +47,22 @@ jobs:
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 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 name: Login to DockerHub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
@ -63,3 +79,15 @@ jobs:
${{ steps.meta.outputs.bake-file }} ${{ steps.meta.outputs.bake-file }}
targets: image-all targets: image-all
push: ${{ startsWith(github.ref, 'refs/tags/') }} 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 }}

View file

@ -28,6 +28,11 @@ RUN --mount=type=bind,rw \
--files="LICENSE" \ --files="LICENSE" \
--files="README.md" --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 FROM scratch AS binary
COPY --from=build /usr/local/bin/registry* / COPY --from=build /usr/local/bin/registry* /

View file

@ -12,6 +12,23 @@ target "binary" {
output = ["./bin"] 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" { target "image" {
inherits = ["docker-metadata-action"] inherits = ["docker-metadata-action"]
} }