Skip to content

Commit 2c380e1

Browse files
author
MochiOS Team
committed
dual release: nightly (prerelease) + stable from every main push
1 parent ce3429b commit 2c380e1

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

‎.github/workflows/build-iso.yml‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches: [main]
66
workflow_dispatch:
77

8-
env:
9-
RELEASE_TAG: nightly
10-
118
jobs:
129
build:
1310
runs-on: ubuntu-latest
@@ -72,17 +69,29 @@ jobs:
7269
runs-on: ubuntu-latest
7370
permissions:
7471
contents: write
72+
strategy:
73+
matrix:
74+
channel:
75+
- tag: nightly
76+
title: MochiOS Nightly
77+
prerelease: true
78+
- tag: stable
79+
title: MochiOS
80+
prerelease: false
7581
steps:
7682
- uses: actions/checkout@v4
7783
- uses: actions/download-artifact@v7
7884
with:
7985
name: mochios-iso
8086
path: /tmp/iso
8187

82-
- name: publish release
88+
- name: publish ${{ matrix.channel.tag }} release
8389
env:
8490
GH_TOKEN: ${{ github.token }}
8591
GH_REPO: ${{ github.repository }}
92+
RELEASE_TAG: ${{ matrix.channel.tag }}
93+
RELEASE_TITLE: ${{ matrix.channel.title }}
94+
PRERELEASE: ${{ matrix.channel.prerelease }}
8695
run: |
8796
cd /tmp/iso
8897
iso=$(ls *.iso 2>/dev/null | head -1)
@@ -100,17 +109,20 @@ jobs:
100109
sha256sum "$iso" > /tmp/iso/SHA256SUMS.txt
101110
echo "" >> /tmp/iso/SHA256SUMS.txt
102111
112+
prerelease_flag=""
113+
[ "$PRERELEASE" = "true" ] && prerelease_flag="--prerelease"
114+
103115
if [ "$size" -ge "$limit" ]; then
104116
echo "iso too large for github release ($size >= $limit), splitting..."
105117
split -b 2000M "$iso" "${iso}.part."
106118
rm -f "$iso"
107119
gh release delete "$RELEASE_TAG" --yes 2>/dev/null || true
108120
gh release create "$RELEASE_TAG" \
109121
"${iso}.part."* join-iso.bat join-iso.sh SHA256SUMS.txt \
110-
--title "MochiOS Nightly" --notes "auto-built from main" --prerelease
122+
--title "$RELEASE_TITLE" --notes "auto-built from main" $prerelease_flag
111123
else
112124
gh release delete "$RELEASE_TAG" --yes 2>/dev/null || true
113125
gh release create "$RELEASE_TAG" \
114126
"$iso" join-iso.bat join-iso.sh SHA256SUMS.txt \
115-
--title "MochiOS Nightly" --notes "auto-built from main" --prerelease
127+
--title "$RELEASE_TITLE" --notes "auto-built from main" $prerelease_flag
116128
fi

0 commit comments

Comments
 (0)