Skip to content

Commit

Permalink
Anchor (#25)
Browse files Browse the repository at this point in the history
* Try to optimize weekly builds

* Try to optimize weekly builds

* Fix syntax error

* Fix syntax errors

* Fix issues 1

* Fix issues 2

* Fix issues 3

* Fix issues 4

* Fix issues 5

* Fix issues 5

* Fix issues 6

* Remove unnecessary action step

* Fix issues 7

* Fix issues 8

* Fix issues 9

* Fix issues 10

* Fix issues 11

* Fix issues 12

* Fix issues 13

* Fix bug & upload missing fie

* Fix issues 14

* Fix issues 15

* Fix issues 15

* Fix issues 16

* Add build for `arm64`

* Make build only limit to 10 runner running at parallel

* Fix syntax issue at line 11

* Try BuildJet to improve build times

* Matrix build (#1)

* Try to optimize weekly builds

* Try to optimize weekly builds

* Fix syntax error

* Fix syntax errors

* Fix issues 1

* Fix issues 2

* Fix issues 3

* Fix issues 4

* Fix issues 5

* Fix issues 5

* Fix issues 6

* Remove unnecessary action step

* Fix issues 7

* Fix issues 8

* Fix issues 9

* Fix issues 10

* Fix issues 11

* Fix issues 12

* Fix issues 13

* Fix bug & upload missing fie

* Fix issues 14

* Fix issues 15

* Fix issues 15

* Fix issues 16

* Add build for `arm64`

* Make build only limit to 10 runner running at parallel

* Fix syntax issue at line 11

* Try BuildJet to improve build times

* Use Github CI & fix some issues

* Fix some issues (#2)

* Use Github CI & fix some issues

* Add Pre-Build checks & fix push issues

* Fix Pre-Build check not cancelling build

* Try to fix permission issue on `Update distro-data.json`

* Use `setup.sh` to download and install requirements

* Try to fix permission issue on 'Update `distro-data.json`'

* Revert 'Use `setup.sh` to download and install requirements'

* Try to fix `setup.sh`

* AUTO: update distro-data.json

* Try to fix permission issue on 'Update `distro-data.json`' (#3)

* Add Pre-Build checks & fix push issues

* Fix Pre-Build check not cancelling build

* Try to fix permission issue on `Update distro-data.json`

* Use `setup.sh` to download and install requirements

* Try to fix permission issue on 'Update `distro-data.json`'

* Revert 'Use `setup.sh` to download and install requirements'

* AUTO: update distro-data.json

---------

Co-authored-by: ThatMG393 <[email protected]>

* AUTO: update distro-data.json

* Update `gen-update-json.py` to adapt to fork

* Try to make CodeFactor A (#4)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection (#5)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection

* Fix `utils.Popen(cmd)` issues (#6)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection

* Fix `utils.Popen(cmd)` issues

* Fix `gen-update-json.py` (#7)

* Fix `gen-update-json.py`

* AUTO: update distro-data.json

* Don't trigger build for specific files (#8)

* Don't trigger build for specific files

* Make Anchor workflow use Matrix implementation

* Create README.md (#9)

* Merge `Codefactor-A` branch (#10)

* Try to fix permission issue on 'Update `distro-data.json`' (#3)

* Add Pre-Build checks & fix push issues

* Fix Pre-Build check not cancelling build

* Try to fix permission issue on `Update distro-data.json`

* Use `setup.sh` to download and install requirements

* Try to fix permission issue on 'Update `distro-data.json`'

* Revert 'Use `setup.sh` to download and install requirements'

* AUTO: update distro-data.json

---------

Co-authored-by: ThatMG393 <[email protected]>

* AUTO: update distro-data.json

* Update `gen-update-json.py` to adapt to fork

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Try to make CodeFactor A (#4)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection

* Fix possible shell injection (#5)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection

* Fix `utils.Popen(cmd)` issues

* Fix `utils.Popen(cmd)` issues (#6)

* Try to make CodeFactor A

* Fix syntax issue of `build-and-release.yml`

* Fix possible shell injection

* Fix `utils.Popen(cmd)` issues

* Fix `gen-update-json.py`

* Don't trigger build for specific files

---------

Co-authored-by: ThatMG393 <[email protected]>

* Auto-generated Matrix JSON

* Fix unclosed expression

* Fix `generate-matrix`

* Fix `generate-matrix`

* Fix `generate-matrix`

* Fix a typo in `gen-matrix-suite.py`

* Remove useless steps

* clean up anchor workflow

* fixup secrets

* fixup secrets

* use all instead of architectures

* remove unused imports

* add a friendly comment

* remove comments in workflows

* better commit message

* fixup secrets

* add missing docstrings

* AUTO JOB: (ANCHOR) update distro-data.json for V3R37

---------

Co-authored-by: ThatMG393 <[email protected]>
Co-authored-by: thatmidcoder393 <[email protected]>
Co-authored-by: ThatMG393 <[email protected]>
Co-authored-by: SaicharanKandukuri <[email protected]>
  • Loading branch information
5 people authored May 1, 2023
1 parent 3a91cdd commit 98f492a
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 316 deletions.
149 changes: 84 additions & 65 deletions .github/workflows/anchor-build-and-release.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,101 @@
name: Build and Release
name: Build and Release (Anchor)
on:
schedule: [{cron: "1 1 1 * *"}]
workflow_dispatch: { }
push:
paths-ignore:
- '**.md'
- '**.json'
- '.gitignore'
- '.vscode/**'
branches:
- anchor


jobs:
BuildRaw:
suite-build:
runs-on: ubuntu-latest
strategy:
max-parallel: 10
fail-fast: false
matrix:
suite: [ jammy ]
variant: [ raw ]
architecture: [ armhf, arm64 ] #, amd64 ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2

- name: Setup Dependencies
run: sudo apt-get update; sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y

- name: checkout submoudles
- name: ⤵️ Install Dependencies
run: |
sudo apt-get update
sudo apt-get install git build-essential binfmt-support qemu-user-static debootstrap -y
- name: 📥 Download Submodules
run: |
git submodule init
git submodule update
- name: Build tarballs
run: |
sudo bash build.sh -s jammy -v raw -a arm64
- name: upload artifacts
- 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: raw-tarballs
path: fs-cook/out/*.tar.gz
Create-Release:
name: ${{ matrix.suite }}-${{ matrix.architecture }}-tarballs
path: fs-cook/out/${{ matrix.suite }}-${{ matrix.variant }}-${{ matrix.architecture }}.tar.gz

create-release:
runs-on: ubuntu-latest
needs:
- BuildRaw

if: ${{ always() }}
needs: suite-build

steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: raw-tarballs
- name: Compute release tag
run: |
pip3 install requests
python3 /home/runner/work/udroid-download/udroid-download/.github/scripts/compute-release-tag.py
- name: Generate release notes
run: sudo bash /home/runner/work/udroid-download/udroid-download/.github/scripts/generate-release-notes.sh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSIONTAG }}
release_name: ${{ env.VERSIONTAG }}
body_path: release.md
draft: false
prerelease: true
- name: Sleep for sometime
run: sleep 60
- name: Upload assets
run: |
set -x
assets=()
for asset in ./*.tar.gz; do
assets+=("-a" "$asset")
done
tag_name="${VERSIONTAG}"
hub release edit -F release.md "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: update json
run: |
sudo apt-get install python3 -y
sudo python3 gen_data/gen-update-json.py --release-tag ${{ env.VERSIONTAG }}
set +e
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add distro-data.json
git commit -m "AUTO: update distro-data.json"
git push
set -e
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: 📥 Download All Tarballs
uses: actions/download-artifact@v3

- 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: ⚙️ Update distro-data.json
uses: stefanzweifel/git-auto-commit-action@v4
with:
skip_fetch: false
skip_checkout: false
commit_message: 'AUTO JOB: (ANCHOR) update distro-data.json for ${{ env.VERSIONTAG }}'
file_pattern: distro-data.json
Loading

0 comments on commit 98f492a

Please sign in to comment.