diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7531c81..22d16e74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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' @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 4ac4d2bf..9d30d377 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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* / diff --git a/docker-bake.hcl b/docker-bake.hcl index eadb4ee1..e1457bb8 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -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"] }