1- ---
2-
31name : Release
42on :
53 push :
64 branches :
7- - ' release/*'
8- - ' release-sqlite/*'
5+ - " release/*"
96
107jobs :
118 release :
12- if : startsWith(github.ref, 'refs/heads/release')
139 runs-on : ubuntu-latest
1410 steps :
15- - name : Install Dependencies
16- run : |
17- sudo apt update
18- sudo apt install coreutils p7zip-full qemu-user-static
19-
20- - name : Checkout CustomPiOS
21- uses : actions/checkout@v4.2.2
22- with :
23- repository : ' guysoft/CustomPiOS'
24- path : CustomPiOS
25- ref : " baaa155f33f54fa0e777039dd47cca751fa55802"
26-
27- - name : Checkout Project Repository
28- uses : actions/checkout@v4.2.2
29- with :
30- path : repository
31- submodules : true
32- fetch-depth : 0
11+ - name : Install Dependencies
12+ run : |
13+ sudo apt update
14+ sudo apt install coreutils p7zip-full qemu-user-static
15+
16+ - name : Checkout CustomPiOS
17+ uses : actions/checkout@v4.2.2
18+ with :
19+ repository : " guysoft/CustomPiOS"
20+ path : CustomPiOS
21+ ref : " baaa155f33f54fa0e777039dd47cca751fa55802"
22+
23+ - name : Checkout Project Repository
24+ uses : actions/checkout@v4.2.2
25+ with :
26+ path : repository
27+ submodules : true
28+ fetch-depth : 0
3329
3430 - name : Install GitVersion
3531 uses : gittools/actions/gitversion/setup@v3.2.1
@@ -42,69 +38,76 @@ jobs:
4238 with :
4339 targetPath : repository
4440
45- - name : Download Raspbian Image
46- run : |
47- cd repository/src/image
48- wget -c --trust-server-names 'https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.5-preinstalled-server-arm64+raspi.img.xz'
49-
50- - name : Update CustomPiOS Paths
51- run : |
52- cd repository/src
53- ../../CustomPiOS/src/update-custompios-paths
54-
55- - name : Set release image version
56- run : |
57- source repository/src/config
58- echo "DIST_VERSION=${{ steps.gitversion.outputs.majorMinorPatch }}" > repository/src/config.local
59-
60- - name : Build Image
61- run : |
62- sudo modprobe loop
63- cd repository/src
64- sudo bash -x ./build_dist
65-
66- - name : Copy output
67- id : copy
68- run : |
69- source repository/src/config
70- TAG=${DIST_VERSION}
71- IMAGE=monsterpi-$TAG
72-
73- cp repository/src/workspace/*.img $IMAGE.img
74-
75- echo "tag=$TAG" >> $GITHUB_OUTPUT
76- echo "image=$IMAGE" >> $GITHUB_OUTPUT
77-
78- - name : Show size and version info
79- run : |
80- echo "Tag ${{steps.copy.outputs.tag}}"
81- echo "File size of ${{ steps.copy.outputs.image }}.img"
82- stat --printf="%s" ${{ steps.copy.outputs.image }}.img
83-
84- - name : Zip Image
85- run : |
86- zip ${{ steps.copy.outputs.image }}.zip ${{ steps.copy.outputs.image }}.img
87- echo "File size of ${{ steps.copy.outputs.image }}.zip"
88- stat --printf="%s" ${{ steps.copy.outputs.image }}.zip
89-
90- - name : Create release
91- uses : actions/create-release@v1
92- id : create_release
93- with :
94- draft : ${{ github.ref_name == 'develop' }}
95- prerelease : ${{ contains(steps.copy.outputs.tag, 'rc') || contains(steps.copy.outputs.tag, 'unstable') }}
96- tag_name : ${{ steps.copy.outputs.tag }}
97- release_name : MonsterPi ${{ steps.copy.outputs.image }}
98- body : " The MonsterPi image for running FDM Monster on Raspberry Pi. Release notes will be added manually." # ${{ steps.build_changelog.outputs.changelog }}
99- env :
100- GITHUB_TOKEN : ${{ github.token }}
101-
102- - name : Upload server bundle zip
103- uses : actions/upload-release-asset@v1
104- env :
105- GITHUB_TOKEN : ${{ github.token }}
106- with :
107- upload_url : ${{ steps.create_release.outputs.upload_url }}
108- asset_path : ${{ steps.copy.outputs.image }}.zip
109- asset_name : ${{ steps.copy.outputs.image }}.zip
110- asset_content_type : application/zip
41+ - name : Determine Release Tag
42+ id : determine_tag
43+ run : |
44+ BRANCH_NAME="${GITHUB_REF#refs/heads/}"
45+ TAG="${{ steps.gitversion.outputs.majorMinorPatch }}-sqlite"
46+ echo "tag=$TAG" >> $GITHUB_OUTPUT
47+
48+ - name : Download Raspbian Image
49+ run : |
50+ cd repository/src/image
51+ wget -c --trust-server-names 'https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.5-preinstalled-server-arm64+raspi.img.xz'
52+
53+ - name : Update CustomPiOS Paths
54+ run : |
55+ cd repository/src
56+ ../../CustomPiOS/src/update-custompios-paths
57+
58+ - name : Set release image version
59+ run : |
60+ source repository/src/config
61+ echo "DIST_VERSION=${{ steps.determine_tag.outputs.tag }}" > repository/src/config.local
62+
63+ - name : Build Image
64+ run : |
65+ sudo modprobe loop
66+ cd repository/src
67+ sudo bash -x ./build_dist
68+
69+ - name : Copy output
70+ id : copy
71+ run : |
72+ source repository/src/config
73+ TAG=${{ steps.determine_tag.outputs.tag }}
74+ IMAGE=monsterpi-$TAG
75+
76+ cp repository/src/workspace/*.img $IMAGE.img
77+
78+ echo "tag=$TAG" >> $GITHUB_OUTPUT
79+ echo "image=$IMAGE" >> $GITHUB_OUTPUT
80+
81+ - name : Show size and version info
82+ run : |
83+ echo "Tag ${{steps.copy.outputs.tag}}"
84+ echo "File size of ${{ steps.copy.outputs.image }}.img"
85+ stat --printf="%s" ${{ steps.copy.outputs.image }}.img
86+
87+ - name : Zip Image
88+ run : |
89+ zip ${{ steps.copy.outputs.image }}.zip ${{ steps.copy.outputs.image }}.img
90+ echo "File size of ${{ steps.copy.outputs.image }}.zip"
91+ stat --printf="%s" ${{ steps.copy.outputs.image }}.zip
92+
93+ - name : Create release
94+ uses : actions/create-release@v1
95+ id : create_release
96+ with :
97+ draft : false
98+ prerelease : ${{ contains(steps.copy.outputs.tag, 'rc') || contains(steps.copy.outputs.tag, 'unstable') }}
99+ tag_name : ${{ steps.copy.outputs.tag }}
100+ release_name : MonsterPi ${{ steps.copy.outputs.image }}
101+ body : " The MonsterPi image for running FDM Monster on Raspberry Pi. Release notes will be added manually." # ${{ steps.build_changelog.outputs.changelog }}
102+ env :
103+ GITHUB_TOKEN : ${{ github.token }}
104+
105+ - name : Upload server bundle zip
106+ uses : actions/upload-release-asset@v1
107+ env :
108+ GITHUB_TOKEN : ${{ github.token }}
109+ with :
110+ upload_url : ${{ steps.create_release.outputs.upload_url }}
111+ asset_path : ${{ steps.copy.outputs.image }}.zip
112+ asset_name : ${{ steps.copy.outputs.image }}.zip
113+ asset_content_type : application/zip
0 commit comments