emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
4.96k stars 327 forks source link

added release workflow #319

Open unfor19 opened 5 months ago

unfor19 commented 5 months ago

@emcrisostomo Feel free to decline; I just thought it might be helpful for others to pull the binaries instead of building it locally. Thank you very much for this tool; I'm using it here unfor19/tfcoding, and it works perfectly.

Example of how to consume it in a Dockerfile:

ARG FSWATCH_VERSION=1.17.1
ARG GITHUB_REPOSITORY=unfor19/fswatch

FROM alpine:3.19 as download
ARG FSWATCH_VERSION
ARG GITHUB_REPOSITORY

ENV OS_ARCH="amd64"
WORKDIR /downloads/fswatch
RUN if [ "$(uname -m)" = "aarch64" ]; then export OS_ARCH=arm64; fi && \
    wget -O fswatch.tar.gz "https://github.com/${GITHUB_REPOSITORY}/releases/download/${FSWATCH_VERSION}/fswatch-${FSWATCH_VERSION}-linux-alpine-${OS_ARCH}.tar.gz" && \
    ls -lah fswatch.tar.gz && \
    tar -xzf fswatch.tar.gz && chmod +x fswatch && rm fswatch.tar.gz

FROM alpine:3.19 as app
# Required for runtime
RUN apk add --no-cache libstdc++ gettext
COPY --from=download /downloads/fswatch/*.so* /usr/local/lib/
COPY --from=download /downloads/fswatch/fswatch /usr/local/bin/fswatch
ENTRYPOINT ["fswatch"]
CMD [ "--help" ]
  1. Build the Docker image:
    docker build -t fswatch .
  2. Run a container and test fswatch
    docker run --rm -it fswatch

If you need any help when it comes to DevOps, let me know, I would love to assist in this project.