Skip to content

Commit

Permalink
github: Build semi-static imaptest binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Oct 7, 2024
1 parent 1390fb0 commit acf3fd3
Showing 1 changed file with 82 additions and 32 deletions.
114 changes: 82 additions & 32 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build static version of imaptest
name: Publish latest imaptest

on:
pull_request:
Expand All @@ -8,9 +8,11 @@ on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-22.04
build_matrix:
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout imaptest
uses: actions/checkout@v4
Expand All @@ -28,42 +30,90 @@ jobs:
working-directory: ${{ github.workspace }}/core
run: |
./autogen.sh
./configure --without-shared-libs --enable-static --disable-shared
make
./configure
make -j8
- name: Build imaptest
working-directory: ${{ github.workspace }}/imaptest
run: |
./autogen.sh
./configure --with-dovecot=../core --enable-static --disable-shared LDFLAGS='--static -llzma'
make
./configure --with-dovecot=../core
make -j8
- name: Strip imaptest
run: |
strip --strip-all imaptest/src/imaptest
- name: Rename artifact
run: |
mv imaptest/src/imaptest imaptest-x86_64-${{ matrix.os }}
- name: Upload Artifact
if: ${{ github.repository == 'dovecot/imaptest' && github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: imaptest
path: imaptest/src/imaptest
publish:
needs: build
if: ${{ github.repository == 'dovecot/imaptest' && github.ref == 'refs/heads/main' }}
name: Publish
runs-on: ubuntu-22.04
name: build-x86_64-${{ matrix.os }}
path: imaptest-x86_64-${{ matrix.os }}
build_container_matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- container: "quay.io/centos/centos:8"
os: centos8
- container: "quay.io/centos/centos:stream9-minimal"
os: centos9
container:
image: ${{ matrix.container }}
steps:
- name: Download artifact
uses: actions/download-artifact@v3
- name: Checkout imaptest
uses: actions/checkout@v4
with:
name: imaptest
path: ./
- name: Make imaptest executable
path: imaptest
- name: Checkout dovecot
uses: actions/checkout@v4
with:
repository: dovecot/core
path: core
- name: Install gettext (missing from GH Actions image)
run: |
chmod +x imaptest
- name: TAR/GZ imaptest
sudo apt install -y gettext
- name: Build dovecot libraries
working-directory: ${{ github.workspace }}/core
run: |
tar czfv imaptest.tgz imaptest
- name: Generate SHA256 checksum
./autogen.sh
./configure
make -j8
- name: Build imaptest
working-directory: ${{ github.workspace }}/imaptest
run: |
sha256sum imaptest.tgz > SHA256SUMS.txt
./autogen.sh
./configure --with-dovecot=../core
make -j8
- name: Strip imaptest
run: |
strip --strip-all imaptest/src/imaptest
- name: Rename artifact
run: |
mv imaptest/src/imaptest imaptest-x86_64-${{ matrix.os }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-x86_64-${{ matrix.os }}
path: imaptest-x86_64-${{ matrix.os }}

publish:
needs: build_matrix
runs-on: ubuntu-latest
steps:
- name: Download items
uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
- name: List files
run: ls -rl
run: |
find
- name: Generate SHA256SUMS.txt
working-directory: build
run: |
sha256sum imaptest-* > SHA256SUMS.txt
- name: Update latest Release
uses: andelf/nightly-release@v1
env:
Expand All @@ -73,8 +123,8 @@ jobs:
name: 'ImapTest Latest Release'
draft: false
body: |
This is a static binary of imaptest (built on Ubuntu 22.04).
This should work on any modern Linux machine using libc.
ImapTest semi-static builds. These work on most machines with matching
libc. These usually work with Debian as well.
files: |
./SHA256SUMS.txt
./imaptest.tgz
build/imaptest-*
build/SHA256SUMS.txt

0 comments on commit acf3fd3

Please sign in to comment.