Skip to content

Commit

Permalink
feat(gh_workflows): docker release
Browse files Browse the repository at this point in the history
  • Loading branch information
banditopazzo committed Oct 19, 2023
1 parent ff185b7 commit fee5e13
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-cross/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A small github action to install [cross](https://github.com/cross-rs/cross) from its latest release.

This action uses the `musl` variant.
This action uses the `musl` variant.
2 changes: 1 addition & 1 deletion .github/actions/install-cross/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ runs:
mv cross* /home/runner/.local/bin
- run: cross --version --verbose
shell: bash
shell: bash
7 changes: 7 additions & 0 deletions .github/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:bookworm

COPY ./pulsar-exec ./pulsar-exec

ENTRYPOINT ./pulsar-exec

CMD [ "pulsard" ]
5 changes: 5 additions & 0 deletions .github/docker/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Exclude everything
**

# # Include pulsar executable
!**/pulsar-exec
15 changes: 15 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
tags:
- '*'
pull_request:

jobs:
vendored_archive:
Expand Down Expand Up @@ -51,13 +52,15 @@ jobs:
platform:
- target: x86_64-unknown-linux-gnu
args: "--features full"
docker-platform: linux/amd64

# For `musl` builds openssl must be vendored
- target: x86_64-unknown-linux-musl
args: "--features full --features openssl-vendored"

- target: aarch64-unknown-linux-gnu
args: "--features full"
docker-platform: linux/arm64

# For `musl` builds openssl must be vendored
- target: aarch64-unknown-linux-musl
Expand All @@ -66,6 +69,7 @@ jobs:
# Dependencies of `xtask` might fail to build on riscv64.
- target: riscv64gc-unknown-linux-gnu
args: "--features full"
docker-platform: linux/riscv64

steps:
- name: Code checkout
Expand All @@ -82,6 +86,17 @@ jobs:
- name: Build Release
run: cross build --locked --target=${{ matrix.platform.target }} --bin pulsar-exec ${{ matrix.platform.args }} --release

- name: Create and push Docker image
uses: docker/build-push-action@v5
if: ${{ matrix.platform.docker-platform == null }}
with:
context: ./target/${{ matrix.platform.target }}/release
file: ../docker/Dockerfile
tags: pulsar-exec
platforms: ${{ matrix.platform.docker-platform }}
push: false
outputs: type=image,name=target

- name: Rename binary
shell: bash
id: rename_binary
Expand Down

0 comments on commit fee5e13

Please sign in to comment.