Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added release workflow #319

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**
!fswatch
!libfswatch
!m4
!man
!po
!test
!*.sh
!*.txt
!*.am
!*.ac
!docker
!COPYING
!AUTHORS*
!NEWS*
!README*
!LICENSE*
!INSTALL*
!CONTRIBUTING*
!ChangeLog*
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

name: Release

on:
push:
tags:
- '*'

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: arm64
os: ubuntu
- arch: amd64
os: ubuntu
- arch: arm64
os: alpine
- arch: amd64
os: alpine
env:
DOCKER_IMAGE_TAG: fswatch-${{ matrix.os }}-${{ matrix.arch }}
DOCKER_CONTAINER_NAME: fswatch-${{ matrix.os }}-${{ matrix.arch }}
DOCKER_PLATFORM: linux/${{ matrix.arch }}
DOCKER_OS: ${{ matrix.os }}
steps:
- uses: actions/[email protected]
- name: Set up QEMU
uses: docker/[email protected]
- name: Build Docker Image
run: docker build -f Dockerfile.${DOCKER_OS} --platform ${DOCKER_PLATFORM} -t ${DOCKER_IMAGE_TAG} .
- name: Run Container
run: docker run --name ${DOCKER_CONTAINER_NAME} -d ${DOCKER_IMAGE_TAG}
- name: Copy Artifacts From Container
run: |
docker cp ${DOCKER_CONTAINER_NAME}:/artifacts .
ls -ltr artifacts
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: artifacts-linux-${{ matrix.os }}-${{ matrix.arch }}
path: artifacts

release:
name: Release
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/[email protected]
with:
path: artifacts
- name: List artifacts
run: ls -ltr artifacts
- name: Release
uses: ncipollo/[email protected]
with:
artifacts: "artifacts/**/*.zip,artifacts/**/*.tar.gz"
allowUpdates: true
name: ${{ github.ref_name }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,7 @@ docker/debian-testing/Dockerfile

# Output files
man/fswatch.7
*~
*.zip
*.tar.gz
*.tgz
*~
21 changes: 21 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM alpine:edge
ARG FSWATCH_VERSION="1.17.1"
RUN apk add --no-cache \
bash git autoconf automake gettext-dev \
libtool make g++ texinfo curl zip

ENV ROOT_HOME="/root" \
DOCKER_OS="alpine"
WORKDIR ${ROOT_HOME}/fswatch
COPY . .
RUN ./autogen.sh && ./configure && make -j && make install
WORKDIR /package
ENV OS_ARCH="amd64"
RUN if [ "$(uname -m)" = "aarch64" ]; then export OS_ARCH=arm64; fi && \
cp /usr/local/bin/fswatch /package/ && \
cp -r /usr/local/lib/*fswatch*.so* /package/ && \
mkdir /artifacts && \
tar -czvf /artifacts/fswatch-${FSWATCH_VERSION}-linux-${DOCKER_OS}-${OS_ARCH}.tar.gz . && \
zip -r /artifacts/fswatch-${FSWATCH_VERSION}-linux-${DOCKER_OS}-${OS_ARCH}.zip . && \
ls -ltr /artifacts
CMD ["/bin/bash"]
20 changes: 20 additions & 0 deletions Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:22.04
ARG FSWATCH_VERSION="1.17.1"
RUN apt-get -y update && \
apt-get install -y bash git autoconf automake gettext autopoint libtool make g++ texinfo curl zip

ENV ROOT_HOME="/root" \
DOCKER_OS="ubuntu"
WORKDIR ${ROOT_HOME}/fswatch
COPY . .
RUN ./autogen.sh && ./configure && make -j && make install
WORKDIR /package
ENV OS_ARCH="amd64"
RUN if [ "$(uname -m)" = "aarch64" ]; then export OS_ARCH=arm64; fi && \
cp /usr/local/bin/fswatch /package/ && \
cp -r /usr/local/lib/*fswatch*.so* /package/ && \
mkdir /artifacts && \
tar -czvf /artifacts/fswatch-${FSWATCH_VERSION}-linux-${DOCKER_OS}-${OS_ARCH}.tar.gz . && \
zip -r /artifacts/fswatch-${FSWATCH_VERSION}-linux-${DOCKER_OS}-${OS_ARCH}.zip . && \
ls -ltr /artifacts
CMD ["/bin/bash"]