Files
Stalwart/.gitea/workflows/release.yml
Cantibra 3814ae8fc7
All checks were successful
Stalwart / Stalwart (amd64, bookworm trixie noble, main, stalwart-x86_64-unknown-linux-gnu, stalwart-cli-x86_64-unknown-linux-gnu) (push) Successful in 1m35s
Stalwart / Stalwart (arm64, bookworm trixie noble, main, stalwart-aarch64-unknown-linux-gnu, stalwart-cli-aarch64-unknown-linux-gnu) (push) Successful in 1m14s
Initialize Git Repository: 'Stalwart'
2026-03-19 14:16:28 +01:00

102 lines
5.4 KiB
YAML

name: Stalwart
on:
push:
branches:
- release
jobs:
workflow:
name: Stalwart
runs-on: cicd
strategy:
matrix:
include:
- architecture: amd64
codename: bookworm trixie noble
component: main
stalwart: stalwart-x86_64-unknown-linux-gnu
stalwartcli: stalwart-cli-x86_64-unknown-linux-gnu
- architecture: arm64
codename: bookworm trixie noble
component: main
stalwart: stalwart-aarch64-unknown-linux-gnu
stalwartcli: stalwart-cli-aarch64-unknown-linux-gnu
steps:
- name: Repository [Clone]
uses: actions/checkout@v6
- name: Environment [Version]
id: environment
run: |
VERSION=$(/usr/bin/cat './.version')
/usr/bin/echo "VERSION=${VERSION}" >> "${GITHUB_OUTPUT}"
/usr/bin/echo "Set Variable 'VERSION' to '${VERSION}'"
- name: Stalwart [Download]
env:
STALWART: ${{ matrix.stalwart }}
STALWARTCLI: ${{ matrix.stalwartcli }}
VERSION: ${{ steps.environment.outputs.version }}
run: |
/usr/bin/wget --verbose --output-document='./stalwart.tar.gz' "https://github.com/stalwartlabs/stalwart/releases/download/v${VERSION}/${STALWART}.tar.gz"
/usr/bin/wget --verbose --output-document='./stalwart-cli.tar.gz' "https://github.com/stalwartlabs/stalwart/releases/download/v${VERSION}/${STALWARTCLI}.tar.gz"
- name: Stalwart [Extract]
run: |
/usr/bin/install --directory --verbose './binaries'
/usr/bin/tar --extract --gzip --verbose --file='./stalwart.tar.gz' --directory='./binaries'
/usr/bin/tar --extract --gzip --verbose --file='./stalwart-cli.tar.gz' --directory='./binaries'
- name: Debian Package [Prepare]
env:
ARCHITECTURE: ${{ matrix.architecture }}
VERSION: ${{ steps.environment.outputs.version }}
run: |
/usr/bin/sed --in-place --expression="s/Architecture:.*/Architecture: ${ARCHITECTURE}/" './stalwart/DEBIAN/control'
/usr/bin/sed --in-place --expression="s/Version:.*/Version: ${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 './binaries/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 './binaries/stalwart' './stalwart/usr/sbin/stalwart'
/usr/bin/chmod --verbose '0755' './stalwart/usr/sbin/stalwart'
- name: Debian Package [Build]
env:
ARCHITECTURE: ${{ matrix.architecture }}
VERSION: ${{ steps.environment.outputs.version }}
run: |
/usr/bin/dpkg-gen './stalwart'
/usr/bin/mv --verbose './stalwart.deb' "./${ARCHITECTURE}_stalwart_${VERSION}.deb"
- name: Debian Repository [Prepare]
env:
ARCHITECTURE: ${{ matrix.architecture }}
CODENAME: ${{ matrix.codename }}
COMPONENT: ${{ matrix.component }}
REPOSITORY_SSH_PRIVATE_KEY: ${{ secrets.REPOSITORY_SSH_PRIVATE_KEY }}
VERSION: ${{ steps.environment.outputs.version }}
run: |
/usr/bin/echo "${REPOSITORY_SSH_PRIVATE_KEY}" > './id_ed25519'
/usr/bin/chmod --quiet '0400' './id_ed25519'
/usr/bin/echo "REPOSITORY_CODENAME='bookworm trixie noble'" > "./${ARCHITECTURE}_stalwart_${VERSION}.cfg"
/usr/bin/echo "Set Configuration 'REPOSITORY_CODENAME' to '${CODENAME}'"
/usr/bin/echo "REPOSITORY_COMPONENT='main'" >> "./${ARCHITECTURE}_stalwart_${VERSION}.cfg"
/usr/bin/echo "Set Configuration 'REPOSITORY_COMPONENT' to '${COMPONENT}'"
- name: Debian Package [Debian Repository Upload]
env:
ARCHITECTURE: ${{ matrix.architecture }}
REPOSITORY_SSH_HOSTNAME: ${{ secrets.REPOSITORY_SSH_HOSTNAME }}
REPOSITORY_SSH_USER: ${{ secrets.REPOSITORY_SSH_USER }}
REPOSITORY_DESTINATION: ${{ secrets.REPOSITORY_DESTINATION }}
VERSION: ${{ steps.environment.outputs.version }}
run: |
/usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" "./${ARCHITECTURE}_stalwart_${VERSION}.deb" "${REPOSITORY_SSH_USER}"@"${REPOSITORY_SSH_HOSTNAME}":"${REPOSITORY_DESTINATION}"
/usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" "./${ARCHITECTURE}_stalwart_${VERSION}.cfg" "${REPOSITORY_SSH_USER}"@"${REPOSITORY_SSH_HOSTNAME}":"${REPOSITORY_DESTINATION}"
- name: Publish Package [Release]
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: |
${{ matrix.architecture }}_stalwart_${{ steps.environment.outputs.version }}.deb