fix: use varient in CI artifacts names to fix duplicate artifact name… #131
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: 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/[email protected] | |
with: | |
name: ${{ matrix.suite }}-${{ matrix.variant }}-${{ 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- ) | |
latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ | |
https://github.com/RandomCoderOrg/udroid-download \ | |
| tail -n1 | cut -d / -f 3) | |
if [[ $latest_tag =~ R([0-9]+)$ ]]; then | |
current_release=${BASH_REMATCH[1]} | |
else | |
current_release=0 | |
fi | |
next_release=$((current_release + 1)) | |
echo "VERSIONTAG=V${udroid_version}ABR${next_release}" >> $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 |