Releas ohne Bedingung #265
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
# This is a basic workflow to help you get started with Actions | |
name: CI mit Artifakte | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push develop or tag or pull request events | |
push: | |
branches: | |
- develop | |
- feature* | |
- release* | |
tags: | |
- '*' | |
pull_request: | |
branches: [ "master" ] | |
# Allows you to run this workflow manually from the Actions tab | |
# workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
# Prepare Build | |
- name: Install Dependencies remove not needed directories | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes coreutils p7zip-full qemu-user-static pv time | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /usr/local/node_modules | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
sudo rm -rf /opt/hostedtoolcache/go | |
sudo rm -rf /opt/hsotedtoolcache/Python /usr/local/.ghcup /usr/local/share/chromium | |
sudo docker system prune --force | |
sudo docker volume prune --force | |
df -h | |
- name: Checkout CustomPiOS | |
uses: actions/checkout@v4 | |
with: | |
repository: 'guysoft/CustomPiOS' | |
path: CustomPiOS | |
- name: Checkout Project Repository | |
uses: actions/checkout@v4 | |
with: | |
path: repository | |
submodules: true | |
- name: Enforce and detach the filesystem from the filesystem hierarchy. | |
run: | | |
sed -i 's/sudo umount $m/sudo umount --lazy --force $m/g' ./CustomPiOS/src/common.sh | |
- name: Update CustomPiOS Paths | |
run: | | |
cd repository/src | |
../../CustomPiOS/src/update-custompios-paths | |
- name: Determine versions number | |
run: echo "version=$(grep DIST_VERSION repository/src/config | cut -d '=' -f 2)" >> $GITHUB_OUTPUT | |
id: version | |
- name: Generate Release Name | |
run: | | |
echo ${{ github.evnet.ref }} | |
ref='refs/tags/v' | |
if [[ ${{ github.event.ref }} == *${ref}* ]]; then | |
echo "release=${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT | |
echo "prerelease=false" >> $GITHUB_OUTPUT | |
else | |
echo "release=${{ steps.version.outputs.version }}-${{ github.ref_name }}-$(date +%y.%m.%d-%H_%M_%S)" >> $GITHUB_OUTPUT | |
echo "prerelease=true" >> $GITHUB_OUTPUT | |
fi | |
cat $GITHUB_OUTPUT | |
id: release_name | |
- name: Build Images | |
run: | | |
sudo modprobe loop | |
cd repository/src | |
echo "Plattenplatz vor Build" | |
df -h | |
time sudo make all || true | |
echo "Plattenplatz nach Build" | |
df -h | |
- name: Create ubuntu_arm64 image | |
id: get_ubuntu_arm64_info | |
run: | | |
source repository/src/config | |
IMAGE=devops-${{ steps.release_name.outputs.release }}_ubuntu_arm64 | |
if [ -f repository/src/workspace-ubuntu_arm64/*.img.x ] | |
then | |
sudo mv repository/src/workspace-ubuntu_arm64/*.img.xz ${IMAGE}.img.xz | |
echo "image=${IMAGE}.img.xz" >> $GITHUB_OUTPUT | |
fi | |
df -h | |
- name: Uploading arm64 ubuntu image as artifact | |
uses: actions/upload-artifact@v4 | |
if: steps.get_ubuntu_arm64_info.outputs.image | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
path: ${{ steps.get_ubuntu_arm64_info.outputs.image }} | |
name: ${{ steps.get_ubuntu_arm64_info.outputs.image }} | |
- name: Create arm64 image | |
id: get_arm64_info | |
run: | | |
source repository/src/config | |
IMAGE=devops-${{ steps.release_name.outputs.release }}_arm64 | |
sudo mv repository/src/workspace-raspios_lite_arm64/*.img.xz ${IMAGE}.img.xz | |
echo "image=${IMAGE}.img.xz" >> $GITHUB_OUTPUT | |
df -h | |
- name: Uploading arm64 image as artifact | |
uses: actions/upload-artifact@v4 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
path: ${{ steps.get_arm64_info.outputs.image }} | |
name: ${{ steps.get_arm64_info.outputs.image }} | |
- name: Create armhf image | |
id: get_armhf_info | |
run: | | |
source repository/src/config | |
IMAGE=devops-${{ steps.release_name.outputs.release }}_armhf | |
sudo mv repository/src/workspace-raspios/*.img.xz ${IMAGE}.img.xz | |
echo "image=${IMAGE}.img.xz" >> $GITHUB_OUTPUT | |
df -h | |
- name: Uploading armhf image as artifact | |
uses: actions/upload-artifact@v4 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
path: ${{ steps.get_armhf_info.outputs.image }} | |
name: ${{ steps.get_armhf_info.outputs.image }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
id: create_release | |
with: | |
draft: false | |
prerelease: ${{ steps.release_name.outputs.prerelease == 'true' }} | |
name: Release ${{ steps.release_name.outputs.release }} | |
#tag_name: ${{ github.ref }} | |
body_path: repository/CHANGELOG.md | |
files: | | |
${{ steps.get_armhf_info.outputs.image }} | |
${{ steps.get_arm64_info.outputs.image }} | |
#${{ steps.get_ubuntu_arm64_info.outputs.image }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |