Skip to content

Build and Release

Build and Release #122

name: Build and Release
on:
schedule: [{cron: "1 1 1 * *"}]
workflow_dispatch: { }
push:
paths-ignore:
- '**.md'
- '**.json'
- '.gitignore'
- '.vscode/**'
branches:
- main
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Generate Matrix JSON
id: set-matrix
run: echo "matrix=$( python3 gen_data/gen-suite-matrix.py )" >> $GITHUB_OUTPUT
suite-build:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
max-parallel: 10
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: docker/setup-qemu-action@v2
- name: ⤵️ Install Dependencies
run: |
sudo apt-get update
sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y
- name: 🛠️ Build ${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }}
run: sudo bash build.sh -s ${{ matrix.suite }} -v ${{ matrix.variant }} -a ${{ matrix.architecture }}
- name: ⬆️ Upload Tarballs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.suite }}-${{ matrix.architecture }}-tarballs
path: fs-cook/out/${{ matrix.suite }}-${{ matrix.variant }}-**.tar.gz
create-release:
runs-on: ubuntu-latest
needs: suite-build
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 📥 Download All Tarballs
uses: actions/[email protected]
- name: 🏷 Generate Release Tag
run: |
udroid_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \
https://github.com/RandomCoderOrg/ubuntu-on-android \
| tail -n1 | cut -d / -f 3 | cut -d v -f 2- )
udroid_download=$(
git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \
https://github.com/RandomCoderOrg/udroid-download \
| tail -n1 | cut -d / -f 3
)
echo "VERSIONTAG=V${udroid_version}${BUILD_TYPE}R$((${udroid_download: -2} + 1))" >> $GITHUB_ENV
- name: 📝 Generate Release Notes
run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh
- name: ⬆️ Upload Suite Tarballs
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.VERSIONTAG }}
name: ${{ env.VERSIONTAG }}
bodyFile: release.md
draft: false
prerelease: false
artifacts: '*-*-tarballs/*.tar.gz'
makeLatest: true
- name: ⚙️ Generate New distro-data.json
run: sudo python3 gen_data/gen-update-json.py --release-tag ${{ env.VERSIONTAG }}
- name: ⚙️ Run git pull
run: git pull -v
- name: ⚙️ Update distro-data.json
uses: stefanzweifel/git-auto-commit-action@v4
with:
skip_fetch: false
skip_checkout: false
commit_message: 'AUTO BOT JOB: (MAIN) update distro-data.json for ${{ env.VERSIONTAG }}'
file_pattern: distro-data.json