mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-30 16:36:29 +01:00
c81a47a692
With setup-beam v1.17.2, make-binaries failed in the Container action with:
* ERROR: No usable Erlang/OTP system for the build machine found! Cannot
* cross compile without such a system.
*
* Either build a bootstrap system for the build machine, or provide
* an Erlang/OTP-26 system in the $PATH, and try again. For more
* information on cross compiling Erlang/OTP-26, see the
* $ERL_TOP/xcomp/README file.
The problematic commit is:
cf854bf149
more concretely this change:
- core.exportVariable(installDirForVarName, cachePath)
+ core.exportVariable(installDirForVarName, catchPathBin)
Up until setup-beam@v1.17.1, the INSTALL_DIR_FOR_OTP was something like
/opt/hostedtoolcache/otp/ubuntu-22.04/OTP-26.1.1/x64
but starting in v1.17.2, the path contains /bin, for example:
/opt/hostedtoolcache/otp/ubuntu-22.04/OTP-26.1.1/x64/bin
124 lines
3.9 KiB
YAML
124 lines
3.9 KiB
YAML
name: Container
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '22 2 */6 * *' # every 6 days to avoid gha cache being evicted
|
|
push:
|
|
paths-ignore:
|
|
- '.devcontainer/**'
|
|
- 'examples/**'
|
|
- 'lib/**'
|
|
- 'man/**'
|
|
- 'priv/**'
|
|
- '**.md'
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
container:
|
|
name: Container
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
packages: write
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Cache build directory
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/build/
|
|
key: ${{runner.os}}-ctr-ct-ng-1.26.0
|
|
|
|
- name: Get erlang/OTP version for bootstrapping
|
|
run: |
|
|
echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV
|
|
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
|
|
uses: erlef/setup-beam@v1.17.2
|
|
with:
|
|
otp-version: ${{ env.OTP_VSN }}
|
|
elixir-version: ${{ env.ELIXIR_VSN }}
|
|
version-type: strict
|
|
|
|
- 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::"
|
|
|
|
- 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
|
|
|
|
- name: Checkout ejabberd-contrib
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: processone/ejabberd-contrib
|
|
path: .ejabberd-modules/sources/ejabberd-contrib
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Get git describe
|
|
id: gitdescribe
|
|
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
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
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
build-args: |
|
|
METHOD=package
|
|
VERSION=${{ steps.gitdescribe.outputs.ver }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
context: .
|
|
file: .github/container/Dockerfile
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|