|
1 |
| -name: Build and Release |
| 1 | +name: Build and Release (Anchor) |
2 | 2 | on:
|
| 3 | + schedule: [{cron: "1 1 1 * *"}] |
| 4 | + workflow_dispatch: { } |
3 | 5 | push:
|
| 6 | + paths-ignore: |
| 7 | + - '**.md' |
| 8 | + - '**.json' |
| 9 | + - '.gitignore' |
| 10 | + - '.vscode/**' |
4 | 11 | branches:
|
5 | 12 | - anchor
|
6 | 13 |
|
| 14 | + |
7 | 15 | jobs:
|
8 |
| - BuildRaw: |
| 16 | + suite-build: |
9 | 17 | runs-on: ubuntu-latest
|
| 18 | + strategy: |
| 19 | + max-parallel: 10 |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + suite: [ jammy ] |
| 23 | + variant: [ raw ] |
| 24 | + architecture: [ armhf, arm64 ] #, amd64 ] |
| 25 | + |
10 | 26 | steps:
|
11 |
| - - uses: actions/checkout@v2 |
| 27 | + - uses: actions/checkout@v3 |
12 | 28 | - uses: docker/setup-qemu-action@v2
|
13 | 29 |
|
14 |
| - - name: Setup Dependencies |
15 |
| - run: sudo apt-get update; sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y |
16 |
| - |
17 |
| - - name: checkout submoudles |
| 30 | + - name: ⤵️ Install Dependencies |
| 31 | + run: | |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y |
| 34 | +
|
| 35 | + - name: 📥 Download Submodules |
18 | 36 | run: |
|
19 | 37 | git submodule init
|
20 | 38 | git submodule update
|
21 |
| - - name: Build tarballs |
22 |
| - run: | |
23 |
| - sudo bash build.sh -s jammy -v raw -a arm64 |
24 |
| - |
25 |
| - - name: upload artifacts |
| 39 | +
|
| 40 | + - name: 🛠️ Build ${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }} |
| 41 | + run: sudo bash build.sh -s ${{ matrix.suite }} -v ${{ matrix.variant }} -a ${{ matrix.architecture }} |
| 42 | + |
| 43 | + - name: ⬆️ Upload Tarballs |
26 | 44 | uses: actions/upload-artifact@v3
|
27 | 45 | with:
|
28 |
| - name: raw-tarballs |
29 |
| - path: fs-cook/out/*.tar.gz |
30 |
| - |
31 |
| - Create-Release: |
| 46 | + name: ${{ matrix.suite }}-${{ matrix.architecture }}-tarballs |
| 47 | + path: fs-cook/out/${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }}.tar.gz |
| 48 | + |
| 49 | + create-release: |
32 | 50 | runs-on: ubuntu-latest
|
33 |
| - needs: |
34 |
| - - BuildRaw |
| 51 | + |
| 52 | + if: ${{ always() }} |
| 53 | + needs: suite-build |
| 54 | + |
35 | 55 | steps:
|
36 |
| - - uses: actions/checkout@v2 |
37 |
| - - uses: actions/download-artifact@v3 |
38 |
| - with: |
39 |
| - name: raw-tarballs |
40 |
| - - name: Compute release tag |
41 |
| - run: | |
42 |
| - pip3 install requests |
43 |
| - python3 /home/runner/work/udroid-download/udroid-download/.github/scripts/compute-release-tag.py |
44 |
| -
|
45 |
| - - name: Generate release notes |
46 |
| - run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh |
47 |
| - - name: Create Release |
48 |
| - id: create_release |
49 |
| - uses: actions/create-release@v1 |
50 |
| - env: |
51 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
52 |
| - with: |
53 |
| - tag_name: ${{ env.VERSIONTAG }} |
54 |
| - release_name: ${{ env.VERSIONTAG }} |
55 |
| - body_path: release.md |
56 |
| - draft: false |
57 |
| - prerelease: true |
58 |
| - - name: Sleep for sometime |
59 |
| - run: sleep 60 |
60 |
| - - name: Upload assets |
61 |
| - run: | |
62 |
| - set -x |
63 |
| - assets=() |
64 |
| - for asset in ./*.tar.gz; do |
65 |
| - assets+=("-a" "$asset") |
66 |
| - done |
67 |
| - tag_name="${VERSIONTAG}" |
68 |
| - hub release edit -F release.md "${assets[@]}" -m "$tag_name" "$tag_name" |
69 |
| - env: |
70 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
71 |
| - |
72 |
| - - name: update json |
73 |
| - run: | |
74 |
| - sudo apt-get install python3 -y |
75 |
| - sudo python3 gen_data/gen-update-json.py --release-tag ${{ env.VERSIONTAG }} |
76 |
| - set +e |
77 |
| - git config user.name github-actions[bot] |
78 |
| - git config user.email 41898282+github-actions[bot]@users.noreply.github.com |
79 |
| - git add distro-data.json |
80 |
| - git commit -m "AUTO: update distro-data.json" |
81 |
| - git push |
82 |
| - set -e |
| 56 | + - uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + |
| 60 | + - name: 📥 Download All Tarballs |
| 61 | + uses: actions/download-artifact@v3 |
| 62 | + |
| 63 | + - name: 🏷 Generate Release Tag |
| 64 | + run: | |
| 65 | + udroid_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ |
| 66 | + https://github.com/RandomCoderOrg/ubuntu-on-android \ |
| 67 | + | tail -n1 | cut -d / -f 3 | cut -d v -f 2- ) |
| 68 | +
|
| 69 | + udroid_download=$( |
| 70 | + git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ |
| 71 | + https://github.com/RandomCoderOrg/udroid-download \ |
| 72 | + | tail -n1 | cut -d / -f 3 |
| 73 | + ) |
| 74 | +
|
| 75 | + echo "VERSIONTAG=V${udroid_version}${BUILD_TYPE}R$((${udroid_download: -2} + 1))" >> $GITHUB_ENV |
| 76 | +
|
| 77 | + - name: 📝 Generate Release Notes |
| 78 | + run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh |
| 79 | + |
| 80 | + - name: ⬆️ Upload Suite Tarballs |
| 81 | + uses: ncipollo/release-action@v1 |
| 82 | + with: |
| 83 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + tag: ${{ env.VERSIONTAG }} |
| 85 | + name: ${{ env.VERSIONTAG }} |
| 86 | + bodyFile: release.md |
| 87 | + draft: false |
| 88 | + prerelease: false |
| 89 | + artifacts: '*-*-tarballs/*.tar.gz' |
| 90 | + makeLatest: true |
| 91 | + |
| 92 | + - name: ⚙️ Generate New distro-data.json |
| 93 | + run: sudo python3 gen_data/gen-update-json.py --release-tag ${{ env.VERSIONTAG }} |
| 94 | + |
| 95 | + - name: ⚙️ Update distro-data.json |
| 96 | + uses: stefanzweifel/git-auto-commit-action@v4 |
| 97 | + with: |
| 98 | + skip_fetch: false |
| 99 | + skip_checkout: false |
| 100 | + commit_message: 'AUTO JOB: (ANCHOR) update distro-data.json for ${{ env.VERSIONTAG }}' |
| 101 | + file_pattern: distro-data.json |
0 commit comments