Skip to content

Merge pull request #34 from fdm-monster/feat/fdm-monster-1.5.0-rc1 #8

Merge pull request #34 from fdm-monster/feat/fdm-monster-1.5.0-rc1

Merge pull request #34 from fdm-monster/feat/fdm-monster-1.5.0-rc1 #8

Workflow file for this run

---
name: Release
on:
push:
branches:
- 'release/*'
jobs:
release:
if: startsWith(github.ref, 'refs/heads/release')
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install coreutils p7zip-full qemu-user-static
- name: Checkout CustomPiOS
uses: actions/checkout@v4.1.0
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS
- name: Checkout Project Repository
uses: actions/checkout@v4.1.0
with:
path: repository
submodules: true
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: '5.x'
- name: Use GitVersion
uses: gittools/actions/gitversion/execute@v0.10.2
id: gitversion
with:
targetPath: repository
- name: Download Raspbian Image
run: |
cd repository/src/image
wget -c --trust-server-names 'https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.5-preinstalled-server-arm64+raspi.img.xz'
- name: Update CustomPiOS Paths
run: |
cd repository/src
../../CustomPiOS/src/update-custompios-paths
- name: Set release image version
run: |
source repository/src/config
echo "DIST_VERSION=${{ steps.gitversion.outputs.majorMinorPatch }}" > repository/src/config.local
- name: Build Image
run: |
sudo modprobe loop
cd repository/src
sudo bash -x ./build_dist
- name: Copy output
id: copy
run: |
source repository/src/config
VERSION=${DIST_VERSION}
IMAGE=monsterpi-$VERSION
cp repository/src/workspace/*.img $IMAGE.img
echo "tag=$VERSION" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
- name: Zip Image
run: |
zip ${{ steps.copy.outputs.image }}.zip ${{ steps.copy.outputs.image }}.img
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: ${{ github.ref_name == 'develop' }}
prerelease: ${{ contains(env.DIST_VERSION, 'rc') || contains(env.DIST_VERSION, 'unstable') }}
tag_name: ${{ steps.copy.outputs.version }}
release_name: MonsterPi ${{ steps.copy.outputs.image }}
body: "Release notes not added" # ${{ steps.build_changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload server bundle zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.copy.outputs.image }}.zip
asset_name: ${{ steps.copy.outputs.image }}.zip
asset_content_type: application/zip