LineageOS Builder #10
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: LineageOS Builder | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Build LineageOS using foss.crave.io | |
runs-on: self-hosted | |
steps: | |
- name: Cleanup | |
run: rm -rf * /crave-devspaces/Lineage20 | |
- name: Create workspace | |
run: mkdir -p /crave-devspaces/Lineage20 | |
continue-on-error: true | |
- name: Enter Workspace | |
run: cd /crave-devspaces/Lineage20 | |
continue-on-error: true | |
# Check-out in order to access the repository's files. | |
- name: Check-out to repository | |
uses: actions/checkout@v4 | |
- name: Test Local Manifests | |
run: | | |
cd /crave-devspaces/Lineage20 | |
rm -rf tester || true | |
mkdir tester | |
cd tester | |
repo init -u https://github.com/LineageOS/android.git -b lineage-20.0 --git-lfs --depth=1 && \ | |
git clone https://github.com/IMYdev/local_manifest.git --depth 1 -b main .repo/local_manifests && \ | |
timeout 1m repo sync --force-sync || { exit_code=$?; [ $exit_code -eq 124 ] || (echo "Error: Process failed with exit code $exit_code"; exit $exit_code); } | |
rm -rf .repo | |
timeout-minutes: 10 | |
- name: Exports | |
run: | | |
export BUILD_HOSTNAME=crave #Todo: export it to github env | |
export BUILD_USERNAME=lion-development | |
- name: Run Script | |
run: cp build.sh /crave-devspaces/Lineage20; cd /crave-devspaces/Lineage20; bash build.sh | |
# Only reach this when the user killed the workflow. | |
- name: Execute if the job is cancelled | |
if: ${{ cancelled() }} | |
run: cd /crave-devspaces/Lineage20; crave stop --all | |
- name: Telegram Notification | |
if: ${{ success() || cancelled() || failure() }} | |
continue-on-error: true | |
uses: xinthink/[email protected] | |
with: | |
chatId: ${{ secrets.TELEGRAM_TO }} | |
botToken: ${{ secrets.TELEGRAM_TOKEN }} | |
jobStatus: ${{ job.status }} | |
skipSuccess: false | |
- name: Find output file | |
run: | | |
mv cd /crave-devspaces/Lineage20/*/*.zip . | |
- name: Upload to Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
*.zip | |
name: LineageOS-${{ github.run_id }} | |
tag_name: ${{ github.run_id }} | |
body: | | |
Target: LineageOS 20 for Lion | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |