-
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (93 loc) · 3.3 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
name: Release
on:
push:
branches:
- 'release/*'
- 'release-sqlite/*'
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/[email protected]
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS
ref: "baaa155f33f54fa0e777039dd47cca751fa55802"
- name: Checkout Project Repository
uses: actions/[email protected]
with:
path: repository
submodules: true
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Use GitVersion
uses: gittools/actions/gitversion/[email protected]
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
TAG=${DIST_VERSION}
IMAGE=monsterpi-$TAG
cp repository/src/workspace/*.img $IMAGE.img
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
- name: Show size and version info
run: |
echo "Tag ${{steps.copy.outputs.tag}}"
echo "File size of ${{ steps.copy.outputs.image }}.img"
stat --printf="%s" ${{ steps.copy.outputs.image }}.img
- name: Zip Image
run: |
zip ${{ steps.copy.outputs.image }}.zip ${{ steps.copy.outputs.image }}.img
echo "File size of ${{ steps.copy.outputs.image }}.zip"
stat --printf="%s" ${{ steps.copy.outputs.image }}.zip
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: ${{ github.ref_name == 'develop' }}
prerelease: ${{ contains(steps.copy.outputs.tag, 'rc') || contains(steps.copy.outputs.tag, 'unstable') }}
tag_name: ${{ steps.copy.outputs.tag }}
release_name: MonsterPi ${{ steps.copy.outputs.image }}
body: "The MonsterPi image for running FDM Monster on Raspberry Pi. Release notes will be added manually." # ${{ 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