name: Stalwart on: push: branches: - release jobs: workflow: name: Stalwart strategy: matrix: include: - architecture: amd64 binary: x86_64 cicd: cicd.any codename: bookworm trixie noble component: main - architecture: arm64 binary: aarch64 cicd: cicd.any codename: bookworm trixie noble component: main runs-on: ${{ matrix.cicd }} steps: - name: Repository (Workspace) [Checkout] uses: actions/checkout@v6 - name: Environment [Source] id: environment run: | source './.env' /usr/bin/echo "VERSION=${VERSION_DAEMON}" >> "${GITHUB_OUTPUT}" /usr/bin/echo "Set Variable 'VERSION' to '${VERSION_DAEMON}'" /usr/bin/echo "VERSION_CLI=${VERSION_CLI}" >> "${GITHUB_OUTPUT}" /usr/bin/echo "Set Variable 'VERSION_CLI' to '${VERSION_CLI}'" /usr/bin/echo "VERSION_DAEMON=${VERSION_DAEMON}" >> "${GITHUB_OUTPUT}" /usr/bin/echo "Set Variable 'VERSION_DAEMON' to '${VERSION_DAEMON}'" - name: Stalwart [Action Cache Hit] uses: actions/cache/restore@v5 id: cache-stalwart with: key: ${{ steps.environment.outputs.version_daemon }}_${{ steps.environment.outputs.version_cli }}_${{ matrix.architecture }} lookup-only: true path: | ./sources - name: Stalwart [Action Cache Restore] if: steps.cache-stalwart.outputs.cache-hit == 'true' uses: actions/cache/restore@v5 with: key: ${{ steps.environment.outputs.version_daemon }}_${{ steps.environment.outputs.version_cli }}_${{ matrix.architecture }} path: | ./sources - name: Stalwart [Download] if: steps.cache-stalwart.outputs.cache-hit != 'true' run: | /usr/bin/wget --verbose --output-document='./stalwart.tar.gz' 'https://github.com/stalwartlabs/stalwart/releases/download/v${{ steps.environment.outputs.version_daemon }}/stalwart-${{ matrix.binary }}-unknown-linux-gnu.tar.gz' /usr/bin/wget --verbose --output-document='./stalwart-cli.tar.xz' 'https://github.com/stalwartlabs/cli/releases/download/v${{ steps.environment.outputs.version_cli }}/stalwart-cli-${{ matrix.binary }}-unknown-linux-gnu.tar.xz' - name: Stalwart [Extract] if: steps.cache-stalwart.outputs.cache-hit != 'true' run: | /usr/bin/install --directory --verbose './sources' /usr/bin/tar --extract --gzip --verbose --file='./stalwart.tar.gz' --directory='./sources' /usr/bin/tar --extract --xz --verbose --file='./stalwart-cli.tar.xz' --directory='./sources' - name: Stalwart [Action Cache Save] if: steps.cache-stalwart.outputs.cache-hit != 'true' uses: actions/cache/save@v5 with: key: ${{ steps.environment.outputs.version_daemon }}_${{ steps.environment.outputs.version_cli }}_${{ matrix.architecture }} path: | ./sources - name: Stalwart [Prepare Debian Package] run: | /usr/bin/sed --in-place --expression='s/Architecture:.*/Architecture: ${{ matrix.architecture }}/' './stalwart/DEBIAN/control' /usr/bin/sed --in-place --expression='s/Version:.*/Version: ${{ steps.environment.outputs.version }}/' './stalwart/DEBIAN/control' /usr/bin/chmod --verbose '0755' './stalwart/DEBIAN/postinst' /usr/bin/chmod --verbose '0755' './stalwart/DEBIAN/postrm' /usr/bin/chmod --verbose '0755' './stalwart/DEBIAN/preinst' /usr/bin/chmod --verbose '0755' './stalwart/DEBIAN/prerm' /usr/bin/chmod --verbose '0755' './stalwart/etc/init.d/stalwart' /usr/bin/chmod --verbose '0640' './stalwart/etc/stalwart.toml' /usr/bin/install --directory --verbose './stalwart/usr/bin' /usr/bin/mv --verbose './sources/stalwart-cli-${{ matrix.binary }}-unknown-linux-gnu/stalwart-cli' './stalwart/usr/bin/stalwart-cli' /usr/bin/chmod --verbose '0755' './stalwart/usr/bin/stalwart-cli' /usr/bin/install --directory --verbose './stalwart/usr/sbin' /usr/bin/mv --verbose './sources/stalwart' './stalwart/usr/sbin/stalwart' /usr/bin/chmod --verbose '0755' './stalwart/usr/sbin/stalwart' - name: Debian Package [Generate] run: | /usr/bin/dpkg-gen './stalwart' /usr/bin/mv --verbose './stalwart.deb' './stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' - name: Release Debian Package [Configuration] run: | /usr/bin/echo '${{ secrets.REPOSITORY_SSH_PRIVATE_KEY }}' > './id_ed25519' /usr/bin/chmod --quiet '0400' './id_ed25519' /usr/bin/echo "REPOSITORY_CODENAME='${{ matrix.codename }}'" > './stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' /usr/bin/echo "Set Configuration 'REPOSITORY_CODENAME' to '${{ matrix.codename }}'" /usr/bin/echo "REPOSITORY_COMPONENT='${{ matrix.component }}'" >> './stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' /usr/bin/echo "Set Configuration 'REPOSITORY_COMPONENT' to '${{ matrix.component }}'" - name: Release Debian Package [PrivLab Repository] uses: https://gitea.com/actions/gitea-release-action@v1 with: name: Stalwart v${{ steps.environment.outputs.version }} tag_name: v${{ steps.environment.outputs.version }} files: | stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb - name: Release Debian Package [Advanced Package Tool Repository] run: | /usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" './stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' '${{ secrets.REPOSITORY_SSH_USER }}'@'${{ secrets.REPOSITORY_SSH_HOSTNAME }}':'${{ secrets.REPOSITORY_DESTINATION }}/stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' /usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" './stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' '${{ secrets.REPOSITORY_SSH_USER }}'@'${{ secrets.REPOSITORY_SSH_HOSTNAME }}':'${{ secrets.REPOSITORY_DESTINATION }}/stalwart_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg'