-
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (163 loc) · 7.39 KB
/
Copy pathrelease.yaml
File metadata and controls
186 lines (163 loc) · 7.39 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: BerryOS Releases
run-name: BerryOS Release (${{ inputs.debian_release }}/${{ inputs.os_version }})
on:
workflow_dispatch:
inputs:
debian_release:
type: choice
required: true
description: "Base Debian release"
default: bookworm
options:
- bullseye
- bookworm
- trixie
os_version:
type: string
description: "OS Version"
default: "nightly"
publish:
type: boolean
description: Publish release
default: false
prerelease:
type: boolean
description: Mark release as pre-release
default: true
concurrency:
group: "${{ inputs.debian_release }}-${{ inputs.os_version }}"
cancel-in-progress: true
jobs:
build_armhf:
uses: ./.github/workflows/builder.yaml
with:
debian_release: ${{ inputs.debian_release }}
os_version: ${{ inputs.os_version }}
build_arch: armhf
build_arm64:
uses: ./.github/workflows/builder.yaml
with:
debian_release: ${{ inputs.debian_release }}
os_version: ${{ inputs.os_version }}
build_arch: arm64
changelog:
runs-on: ubuntu-latest
outputs:
name: ${{ steps.vars.outputs.name }}
tag_name: ${{ steps.vars.outputs.tag_name }}
build_date: ${{ steps.vars.outputs.build_date }}
content: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate variables
id: vars
shell: bash
env:
OS_VERSION: ${{ inputs.os_version }}
DEBIAN_RELEASE: ${{ inputs.debian_release }}
GH_TOKEN: ${{ github.token }}
run: |
echo "name=BerryOS ${DEBIAN_RELEASE^} ${OS_VERSION^}" | tee -a "${GITHUB_OUTPUT}"
echo "tag_prev=$(gh release view --json tagName -q .tagName || git rev-list --reflog --max-parents=0)" | tee -a "${GITHUB_OUTPUT}"
echo "tag_name=${DEBIAN_RELEASE}/${OS_VERSION}" | tee -a "${GITHUB_OUTPUT}"
echo "build_date=$(date -u +'%Y-%m-%d')" | tee -a "${GITHUB_OUTPUT}"
- name: Generate changelog
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: .github/cliff.toml
args: >
--strip=header
--tag="${{ steps.vars.outputs.tag_name }}"
"${{ steps.vars.outputs.tag_prev }}.."
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ github.token }}
release:
needs: [changelog, build_armhf, build_arm64]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: out/
artifact-ids: >
${{ needs.build_armhf.outputs.artifact_id }},
${{ needs.build_arm64.outputs.artifact_id }}
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
if: ${{ inputs.os_version != 'nightly' }}
with:
tag_name: ${{ needs.changelog.outputs.tag_name }}
name: ${{ needs.changelog.outputs.name }}
draft: ${{ !inputs.publish }}
prerelease: ${{ inputs.prerelease }}
target_commitish: ${{ github.sha }}
body: |
## Changelog
${{ needs.changelog.outputs.content }}
## Compatibility
- `BerryOS/armhf`
- Image: [`${{ needs.build_armhf.outputs.image }}`](https://github.com/${{ github.repository }}/releases/download/${{ needs.changelog.outputs.tag_name }}/${{ needs.build_armhf.outputs.image }})
- Compatibility: all Raspberry Pi models
- `BerryOS/arm64`
- Image: [`${{ needs.build_arm64.outputs.image }}`](https://github.com/${{ github.repository }}/releases/download/${{ needs.changelog.outputs.tag_name }}/${{ needs.build_arm64.outputs.image }})
- Compatibility:
- Raspberry Pi 3B, 3B+, 4 B & 400
- Compute Module 3, 3+ & 4
- Raspberry Pi Zero 2 W
- Raspberry Pi 5
## Issues
If you find any issues when using this build, please report them to the [issue tracker](https://github.com/${{ github.repository }}/issues). Make sure to include the content of `/etc/rpi-issue` (also available in `/boot/firmware/issue.txt`) in your report so we can pin-point the specific build you are using.
files: out/*
fail_on_unmatched_files: true
- name: Upsert nightly release
uses: softprops/action-gh-release@v2
if: ${{ inputs.os_version == 'nightly' }}
with:
tag_name: ${{ needs.changelog.outputs.tag_name }}
name: ${{ needs.changelog.outputs.name }} (${{ needs.changelog.outputs.build_date }})
draft: ${{ !inputs.publish }}
prerelease: ${{ inputs.prerelease }}
target_commitish: ${{ github.sha }}
body: |
## Nightly Build
This is an automated nightly release. It includes daily built versions of the BerryOS images.
### Why use a nightly build?
Nightly builds allow you to make sure you are using an image that includes the latest version of all install packages. Making the initial setup of BerryOS faster.
It shouldn't be much different than using a stable release, but it might be a bit more unstable, especially during major updates (when BerryOS needs to be synced with the latest changes from Raspberry Pi OS).
### Disclaimer
These builds are provided without any warranty. No manual testing or benchmarks have been performed.
If you prefer a stable version, please download the [latest stable release](https://github.com/${{ github.repository }}/releases/latest).
## Changes since last stable release
${{ needs.changelog.outputs.content }}
## Compatibility
- `BerryOS/armhf`
- Image: [`${{ needs.build_armhf.outputs.image }}`](https://github.com/${{ github.repository }}/releases/download/${{ needs.changelog.outputs.tag_name }}/${{ needs.build_armhf.outputs.image }})
- Compatibility: all Raspberry Pi models
- `BerryOS/arm64`
- Image: [`${{ needs.build_arm64.outputs.image }}`](https://github.com/${{ github.repository }}/releases/download/${{ needs.changelog.outputs.tag_name }}/${{ needs.build_arm64.outputs.image }})
- Compatibility:
- Raspberry Pi 3B, 3B+, 4 B & 400
- Compute Module 3, 3+ & 4
- Raspberry Pi Zero 2 W
- Raspberry Pi 5
## Issues
If you find any issues when using a nightly build, please report them to the [issue tracker](https://github.com/${{ github.repository }}/issues). Make sure to include the content of `/etc/rpi-issue` (also available in `/boot/firmware/issue.txt`) in your report so we can pin-point the specific build you are using.
files: out/*
fail_on_unmatched_files: true
- name: Update nightly tag
uses: actions/github-script@v7
if: ${{ inputs.os_version == 'nightly' }}
with:
script: |
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${{ needs.changelog.outputs.tag_name }}`,
sha: context.sha
});