2022-04-25 11:06:01 +02:00
|
|
|
name: Container
|
|
|
|
|
|
|
|
on:
|
2022-11-18 21:55:17 +01:00
|
|
|
schedule:
|
|
|
|
- cron: '22 2 */6 * *' # every 6 days to avoid gha cache being evicted
|
2022-04-25 11:06:01 +02:00
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.devcontainer/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'man/**'
|
|
|
|
- 'priv/**'
|
|
|
|
- '**.md'
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
container:
|
|
|
|
name: Container
|
2024-02-01 17:02:14 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-04-25 11:06:01 +02:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2023-09-11 08:16:03 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-11-18 21:55:17 +01:00
|
|
|
- name: Cache build directory
|
2024-02-01 17:02:44 +01:00
|
|
|
uses: actions/cache@v4
|
2022-11-18 21:55:17 +01:00
|
|
|
with:
|
|
|
|
path: ~/build/
|
2024-02-05 11:26:00 +01:00
|
|
|
key: ${{runner.os}}-ctr-ct-ng-1.26.0
|
2022-11-18 21:55:17 +01:00
|
|
|
|
|
|
|
- name: Get erlang/OTP version for bootstrapping
|
|
|
|
run: |
|
2024-02-14 23:16:27 +01:00
|
|
|
echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.rc-]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV
|
2022-11-18 21:55:17 +01:00
|
|
|
echo "ELIXIR_VSN=$(awk '/^elixir_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: |
|
|
|
|
sudo apt-get -qq update
|
|
|
|
sudo apt-get -qq install makeself
|
|
|
|
# https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu21.10/Dockerfile
|
|
|
|
sudo apt-get -qq install build-essential autoconf bison flex gawk
|
|
|
|
sudo apt-get -qq install help2man libncurses5-dev libtool libtool-bin
|
|
|
|
sudo apt-get -qq install python3-dev texinfo unzip
|
|
|
|
|
|
|
|
- name: Install erlang/OTP
|
2024-02-24 17:14:36 +01:00
|
|
|
uses: erlef/setup-beam@v1
|
2022-11-18 21:55:17 +01:00
|
|
|
with:
|
|
|
|
otp-version: ${{ env.OTP_VSN }}
|
|
|
|
elixir-version: ${{ env.ELIXIR_VSN }}
|
|
|
|
version-type: strict
|
|
|
|
|
2023-01-27 15:34:42 +01:00
|
|
|
- name: Remove Elixir Matchers
|
|
|
|
run: |
|
|
|
|
echo "::remove-matcher owner=elixir-mixCompileWarning::"
|
|
|
|
echo "::remove-matcher owner=elixir-credoOutputDefault::"
|
|
|
|
echo "::remove-matcher owner=elixir-mixCompileError::"
|
|
|
|
echo "::remove-matcher owner=elixir-mixTestFailure::"
|
|
|
|
echo "::remove-matcher owner=elixir-dialyzerOutputDefault::"
|
|
|
|
|
2022-11-18 21:55:17 +01:00
|
|
|
- name: Build musl-libc based binary archives
|
|
|
|
run: |
|
|
|
|
sed -i "s|targets='.*'|targets='x86_64-linux-musl aarch64-linux-musl'|" tools/make-binaries
|
|
|
|
mv .github/container/ejabberdctl.template .
|
|
|
|
CHECK_DEPS=false tools/make-binaries
|
|
|
|
|
|
|
|
- name: Collect packages
|
|
|
|
run: |
|
|
|
|
mkdir tarballs
|
|
|
|
mv ejabberd-*.tar.gz tarballs
|
|
|
|
|
2022-09-12 18:00:14 +02:00
|
|
|
- name: Checkout ejabberd-contrib
|
2023-09-11 08:16:03 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-12 18:00:14 +02:00
|
|
|
with:
|
|
|
|
repository: processone/ejabberd-contrib
|
|
|
|
path: .ejabberd-modules/sources/ejabberd-contrib
|
|
|
|
|
2022-04-25 11:06:01 +02:00
|
|
|
- name: Log in to the Container registry
|
2023-09-18 08:37:41 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get git describe
|
|
|
|
id: gitdescribe
|
2023-01-16 13:46:51 +01:00
|
|
|
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2023-09-18 08:37:44 +02:00
|
|
|
uses: docker/metadata-action@v5
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
|
|
|
|
org.opencontainers.image.licenses=GPL-2.0
|
|
|
|
org.opencontainers.image.vendor=ProcessOne
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2023-09-18 08:37:47 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2023-09-18 08:37:50 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Build and push Docker image
|
2023-09-18 08:37:53 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
build-args: |
|
2022-11-18 21:55:17 +01:00
|
|
|
METHOD=package
|
2022-04-25 11:06:01 +02:00
|
|
|
VERSION=${{ steps.gitdescribe.outputs.ver }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2022-09-06 19:59:33 +02:00
|
|
|
context: .
|
|
|
|
file: .github/container/Dockerfile
|
2022-04-25 11:06:01 +02:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-05-04 12:39:59 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-04-25 11:06:01 +02:00
|
|
|
push: true
|
2022-05-06 17:58:58 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|