-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Github Action release definition for Ubuntu 20.04.
- Loading branch information
1 parent
5044794
commit 4023191
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: release-zimbra | ||
|
||
on: | ||
push: | ||
tags: | ||
- builds-ubuntu-20.04/* | ||
|
||
env: | ||
DOCKER_IMAGE_FQDN_TAG: ghcr.io/maldua/zimbra-foss-builder:docker-ubuntu-20.04-v0.0.1 | ||
DISTRO_FULLNAME: Ubuntu 20.04 | ||
DISTRO_BUILD_DIR_PREFIX: UBUNTU20_64 | ||
DISTRO_TAG_PREFIX: ubuntu-20.04 | ||
ZIMBRA_BUILDER_ID: maldua | ||
|
||
jobs: | ||
zimbra-release: | ||
strategy: | ||
matrix: | ||
TARGET_DISTRO: [ "ubuntu-20.04" ] | ||
runs-on: ubuntu-latest | ||
environment: git_clone | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Split branch name | ||
env: | ||
BRANCH: ${{ github.ref_name }} | ||
id: split-tag | ||
run: echo "version=${BRANCH##*/}" >> $GITHUB_OUTPUT | ||
- name: Prepare .ssh directory | ||
run: | | ||
mkdir ${{ github.workspace }}/.ssh | ||
chmod 700 ${{ github.workspace }}/.ssh | ||
echo "${{ secrets.read_only_ssh_key }}" > ${{ github.workspace }}/.ssh/id_rsa | ||
chmod 600 ${{ github.workspace }}/.ssh/id_rsa | ||
- name: Get runner uid | ||
id: runner | ||
run: | | ||
echo "uid=$(id -u)" >> $GITHUB_OUTPUT | ||
echo "gid=$(id -g)" >> $GITHUB_OUTPUT | ||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
image: ${{ env.DOCKER_IMAGE_FQDN_TAG }} | ||
options: -v ${{ github.workspace }}:/usr/local/zimbra-foss-builder:ro -v ${{ github.workspace }}/BUILDS:/home/build/installer-build/BUILDS:rw -v ${{ github.workspace }}/.ssh:/root/.ssh:rw | ||
shell: bash | ||
run: | | ||
chown root:root /root/.ssh/ | ||
chown root:root /root/.ssh/id_rsa | ||
touch /root/.ssh/known_hosts | ||
ssh-keyscan github.com >> /root/.ssh/known_hosts | ||
cd /home/build | ||
/usr/local/zimbra-foss-builder/zimbra-smart-builder.sh ${{ steps.split-tag.outputs.version }} ${{ env.ZIMBRA_BUILDER_ID }} | ||
chown -R ${{ steps.runner.outputs.uid }}:${{ steps.runner.outputs.gid }} /home/build/installer-build/BUILDS/* | ||
- run: ls -la ${{ github.workspace }}/BUILDS/ | ||
- name: Get tgz release filename | ||
id: tgz-release | ||
run: | | ||
RELEASE_DIR=$(find ${{ github.workspace }}/BUILDS -name '${{ env.DISTRO_BUILD_DIR_PREFIX }}*' -type d) | ||
RELEASE_TGZ=$(find "${RELEASE_DIR}" -name "zcs-*.tgz" -type f) | ||
RELEASE_SHORT_TGZ=$(basename ${RELEASE_TGZ}) | ||
echo "directory=${RELEASE_DIR}" >> $GITHUB_OUTPUT | ||
echo "filename=${RELEASE_TGZ}" >> $GITHUB_OUTPUT | ||
echo "shortfilename=${RELEASE_SHORT_TGZ}" >> $GITHUB_OUTPUT | ||
- name: Get zimbra-builder.sh commands | ||
id: zimbra-builder | ||
run: | | ||
echo "commands<<EOF"$'\n'"$(cat ${{ github.workspace }}/BUILDS/zimbra-builder-commands.txt)"$'\n'EOF >> $GITHUB_OUTPUT | ||
- name: Generate checksums | ||
run: | | ||
cd ${{ steps.tgz-release.outputs.directory }} | ||
md5sum ${{ steps.tgz-release.outputs.shortfilename }} > ${{ steps.tgz-release.outputs.shortfilename }}.md5 | ||
sha256sum ${{ steps.tgz-release.outputs.shortfilename }} > ${{ steps.tgz-release.outputs.shortfilename }}.sha256 | ||
- name: Release | ||
uses: crowbarmaster/[email protected] | ||
with: | ||
repo_token: ${{ github.token }} | ||
prerelease: true | ||
generate_notes: false | ||
automatic_release_tag: zimbra-foss-build-${{ env.DISTRO_TAG_PREFIX }}/${{ steps.split-tag.outputs.version }} | ||
title: Zimbra ${{ steps.split-tag.outputs.version }} FOSS Builds ( ${{ env.DISTRO_FULLNAME }} ) | ||
body: | | ||
**WARNING:** This is an experimental build. If you still want to use it and give us some feedback. Please go ahead on the [issues page](https://github.com/maldua/zimbra-foss-builder/issues). | ||
Main instructions that were used in order to make this build possible: | ||
``` | ||
${{ steps.zimbra-builder.outputs.commands }} | ||
``` | ||
files: | | ||
${{ steps.tgz-release.outputs.filename }} | ||
${{ steps.tgz-release.outputs.filename }}.md5 | ||
${{ steps.tgz-release.outputs.filename }}.sha256 | ||