88 lines
4.4 KiB
YAML
88 lines
4.4 KiB
YAML
name: Gitea
|
|
on:
|
|
push:
|
|
branches:
|
|
- release
|
|
jobs:
|
|
workflow:
|
|
name: Gitea
|
|
runs-on: cicd
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- architecture: amd64
|
|
codename: bookworm trixie noble
|
|
component: main
|
|
- architecture: arm64
|
|
codename: bookworm trixie noble
|
|
component: main
|
|
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: Gitea [Download]
|
|
env:
|
|
ARCHITECTURE: ${{ matrix.architecture }}
|
|
VERSION: ${{ steps.environment.outputs.version }}
|
|
run: |
|
|
/usr/bin/install --directory --verbose './sources'
|
|
/usr/bin/wget --verbose --output-document='./sources/gitea' "https://dl.gitea.com/gitea/${VERSION}/gitea-${VERSION}-linux-${ARCHITECTURE}"
|
|
- name: Debian Package [Prepare]
|
|
env:
|
|
ARCHITECTURE: ${{ matrix.architecture }}
|
|
VERSION: ${{ steps.environment.outputs.version }}
|
|
run: |
|
|
/usr/bin/sed --in-place --expression="s/Architecture:.*/Architecture: ${ARCHITECTURE}/" './gitea/DEBIAN/control'
|
|
/usr/bin/sed --in-place --expression="s/Version:.*/Version: ${VERSION}/" './gitea/DEBIAN/control'
|
|
/usr/bin/chmod --verbose '0755' './gitea/DEBIAN/postinst'
|
|
/usr/bin/chmod --verbose '0755' './gitea/DEBIAN/postrm'
|
|
/usr/bin/chmod --verbose '0755' './gitea/DEBIAN/preinst'
|
|
/usr/bin/chmod --verbose '0755' './gitea/DEBIAN/prerm'
|
|
/usr/bin/chmod --verbose '0755' './gitea/etc/init.d/gitea'
|
|
/usr/bin/install --directory --verbose './gitea/usr/sbin'
|
|
/usr/bin/mv --verbose './sources/gitea' './gitea/usr/sbin/gitea'
|
|
/usr/bin/chmod --verbose '0755' './gitea/usr/sbin/gitea'
|
|
- name: Debian Package [Build]
|
|
env:
|
|
ARCHITECTURE: ${{ matrix.architecture }}
|
|
VERSION: ${{ steps.environment.outputs.version }}
|
|
run: |
|
|
/usr/bin/dpkg-gen './gitea'
|
|
/usr/bin/mv --verbose './gitea.deb' "./${ARCHITECTURE}_gitea_${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}_gitea_${VERSION}.cfg"
|
|
/usr/bin/echo "Set Configuration 'REPOSITORY_CODENAME' to '${CODENAME}'"
|
|
/usr/bin/echo "REPOSITORY_COMPONENT='main'" >> "./${ARCHITECTURE}_gitea_${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}_gitea_${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}_gitea_${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: Gitea v${{ steps.environment.outputs.version }}
|
|
tag_name: v${{ steps.environment.outputs.version }}
|
|
files: |
|
|
${{ matrix.architecture }}_gitea_${{ steps.environment.outputs.version }}.deb
|