Changelog for all #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Changelog for all" | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch from' | |
required: false | |
default: '' | |
schedule: | |
- cron: '0 0 * * MON' | |
jobs: | |
prepare: | |
name: "Load sources JSON" | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{steps.json.outputs.JSON_CONTENT}} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
with: | |
repository: armbian/os | |
fetch-depth: 0 | |
ref: main | |
clean: false | |
- name: "Make JSON" | |
id: json | |
run: | | |
# checkout to 7 days old when we will have 7 days history, now 1 | |
git checkout $(git log --since=2.days --tags --simplify-by-decoration --pretty="format:%D" | \ | |
tail -1 | xargs | cut -d" " -f2) | |
echo 'JSON_CONTENT<<EOF' >> $GITHUB_OUTPUT | |
cat git_sources.json | jq '.[] | select(.source|test("^h.*armbian*.")) ' | jq -s >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
gradle: | |
needs: prepare | |
strategy: | |
fail-fast: false | |
max-parallel: 18 | |
matrix: | |
include: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
name: "Get changes from" | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: "URL=${{ matrix.source }} Branch=${{ matrix.branch }} SHA=${{ matrix.sha1 }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mkdir -p artifact | |
# extract needed information | |
source="${{ matrix.source }}" | |
source=${source/.git/} | |
# For kernel.org rather uses Google mirror. Its faster and more reliable | |
source=$(echo $source | sed 's|https://git.kernel.org|https://kernel.googlesource.com|') | |
# Clone everything into check folder | |
git clone $source --bare -b ${{ matrix.branch }} check | |
githash=$(git -C check rev-parse ${{ matrix.branch }}) | |
# Debug. If hashes are not the same and there are no record, there could be something wrong | |
if [[ "${{ matrix.sha1 }}" != "${githash}" ]]; then | |
echo "URL=$source Current SHA=$githash -> wanted SHA=${{ matrix.sha1 }}" >> $GITHUB_STEP_SUMMARY | |
fi | |
# giturl is used as tag, extract it from sources URL | |
giturl=${source/https:\/\/github.com\//} | |
giturl=${giturl/https:\/\/kernel.googlesource.com\/pub\/scm\/linux\/kernel\/git\//} | |
# GitHub handling is a bit different | |
if [[ "${source}" == *github* ]]; then | |
git -C check log ${{ matrix.sha1 }}..HEAD --pretty="%H|%s" | | |
while IFS="|" read -r hash title; do | |
curl -s https://api.github.com/repos/${giturl}/commits/${hash}/pulls | \ | |
jq -rc '.[].user.login + "|" + .[].html_url + "|" + .[].title + "|" + .[].repo.full_name + "|" + .[].repo.html_url' | | |
while IFS="|" read -r user pullurl prtitle desc repourl; do | |
short_hash=$(echo $hash | cut -c 1-7) | |
# get correct author | |
author=$(curl -s https://api.github.com/repos/${giturl}/commits/${hash} | jq -rc '.author.login') | |
# | |
if [[ -n $title ]]; then echo "* $title by @$author in <a href=$pullurl>$short_hash</a> <a href=$source>\`$giturl\`</a>" | \ | |
tee -a artifact/${{ matrix.sha1 }}.txt >> $GITHUB_STEP_SUMMARY; fi | |
done | |
done | |
else | |
URL=$(git -C check config --get remote.origin.url) | |
REPO=$(basename -s .git `git -C check config --get remote.origin.url`) | |
git -C check log ${{ matrix.sha1 }}..HEAD --pretty="%s|%an|%ae|%h|%H" --max-parents=1 | | |
while IFS="|" read -r title user usermail hash bighash; do | |
if [[ -n $title ]]; then | |
# backtrace and display GitHub username if it exists, else show email | |
email_search=$(curl -s https://api.github.com/search/users\?q\=${usermail} | jq -rc '.items | .[] | .login' || true) | |
if [[ -n $email_search ]]; then | |
user="@""${email_search}"; | |
else | |
user="$user <$usermail>" | |
fi | |
echo "* $title by $user in <a href=\"$URL/+/${bighash}\">$hash</a> <a href=$URL>\`$REPO\`</a>" | \ | |
tee -a artifact/${{ matrix.sha1 }}.txt >> $GITHUB_STEP_SUMMARY; | |
fi | |
done | |
fi | |
- name: Upload resoults | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.sha1 }} | |
path: artifact | |
if-no-files-found: ignore | |
make: | |
needs: gradle | |
name: "Sort" | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: "merged" | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
delete-merged: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: merged-artifacts | |
- name: Display structure of downloaded files | |
run: find -name "*.txt" -exec cat {} \; | sort >> $GITHUB_STEP_SUMMARY | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: merged-artifacts | |
failOnError: false | |
- name: "Checkout OS repository to get latest tag" | |
uses: actions/checkout@v4 | |
with: | |
repository: armbian/os | |
fetch-depth: 0 | |
clean: false | |
path: os | |
- name: "Read nightly version from file" | |
run: | | |
cat "os/nightly.json" | jq '.version' | sed "s/\"//g" | sed 's/^/VERSION_OVERRIDE=/' >> $GITHUB_ENV | |
- name: "Generate body file" | |
run: | | |
echo " | |
<h1>Armbian rolling releases</h1> | |
<p> | |
<a href='https://www.armbian.com/download/'><img alt='Armbian Linux stable' src='https://img.shields.io/badge/dynamic/json?label=Armbian%20Linux%20current&query=CURRENT&color=f71000&cacheSeconds=600&style=for-the-badge&url=https%3A%2F%2Fgithub.com%2Farmbian%2Fscripts%2Freleases%2Fdownload%2Fstatus%2Frunners_capacity.json'></a> | |
<a href='https://www.armbian.com/download/'><img alt='Armbian Linux rolling' src='https://img.shields.io/badge/dynamic/json?label=Armbian%20Linux%20edge&query=EDGE&color=34be5b&cacheSeconds=600&style=for-the-badge&url=https%3A%2F%2Fgithub.com%2Farmbian%2Fscripts%2Freleases%2Fdownload%2Fstatus%2Frunners_capacity.json'></a> | |
</p> | |
<br> | |
- rolling releases are available at the bottom of <a href='https://www.armbian.com/download/' target=_blanks>official download pages</a> | |
- <a href='https://github.com/armbian/os/wiki/Enable-build-configuration'>How to change type of images that are provided by Armbian</a>? | |
- How to switch between <a href='https://www.armbian.com/newsflash/armbian-leaflet-25/' target=_blank>stable and rolling release</a>? | |
Please note that <b>Armbian Rolling Releases</b> are not recommended for production environments, as these builds are not thoroughly tested. However, in most cases, they should work well. Before making this switch, we recommend checking our <a target=_blanks href='https://github.com/armbian/os?tab=readme-ov-file#latest-smoke-tests-results'>automated tests</a>. | |
</p> | |
## What's was changed in past week?" > body.html | |
find -name "*.txt" -exec cat {} \; >> body.html | |
- uses: ncipollo/release-action@v1 | |
with: | |
owner: 'armbian' | |
repo: 'build' | |
tag: "v${{ env.VERSION_OVERRIDE }}" | |
name: "v${{ env.VERSION_OVERRIDE }}" | |
generateReleaseNotes: "false" | |
prerelease: "false" | |
makeLatest: "true" | |
bodyFile: "body.html" | |
allowUpdates: "true" | |
skipIfReleaseExists: "true" | |
token: ${{ secrets.RELEASE_TOKEN }} |