Skip to content

Commit

Permalink
feat(ci): improve workflows (#279)
Browse files Browse the repository at this point in the history
* feat(ci): improve workflows

* feat(ci): improve workflows

* fix(ci): mass-rebuild.yml

* fix(ci): rename mass-rebuild-recurse.yml
  • Loading branch information
madonuko authored Mar 16, 2023
1 parent 50888ba commit 53cc322
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 285 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
container:
image: ghcr.io/terrapkg/builder:main
options: --cap-add=SYS_ADMIN --privileged
# check out the repo
steps:
- name: Set workspace as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand All @@ -28,27 +27,6 @@ jobs:
with:
fetch-depth: 2
- run: git pull
#- run: git checkout HEAD^

# - name: Generate Build matrix
# id: generate_build_matrix
# # generate build matrix by checking out changes in anda/
# run: |
# # get the list of changed folders in the current commit, including subfolders
# changed_folders=$(git diff --name-only HEAD^ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u )
# echo "Changed folders: $changed_folders"
# # if changed_folders is empty then set is empty to true
# if [ -z "$changed_folders" ]; then
# echo "::set-output name=is_empty::true"
# else
# echo "::set-output name=is_empty::false"
# fi
# # turn it into a json array
# build_matrix=$(echo "$changed_folders" | jq -R . | jq -s . | jq -c .)

# echo "::set-output name=build_matrix::$build_matrix"
# #echo "::set-output name=build_matrix::$build_matrix"

- name: Generate build matrix
id: generate_build_matrix
run: |
Expand All @@ -60,7 +38,6 @@ jobs:
pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }}
version: ["37"]
fail-fast: false
#if: ${{ matrix.changed_folders != '' }}
runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }}
container:
image: ghcr.io/terrapkg/builder:main
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/bootstrap-anda.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/bootstrap-f38.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/bootstrap-subatomic.yml

This file was deleted.

13 changes: 3 additions & 10 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bootstrap Andaman and Subatomic (Fedora 37)
name: Bootstrap Andaman and Subatomic

on:
workflow_dispatch:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Build Subatomic
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
anda build -c anda-37-${{ matrix.arch }} subatomic -p rpm -D "autogitcommit $(git log -1 --format='%H')"
anda build -c anda-${{ matrix.version }}-${{ matrix.arch }} subatomic -p rpm -D "autogitcommit $(git log -1 --format='%H')"
- name: Install Subatomic
run: sudo dnf install -y ./anda-build/rpm/rpms/subatomic-*.rpm

Expand All @@ -52,14 +52,7 @@ jobs:
repository: FyraLabs/anda

- name: Build Andaman
run: anda build -c anda-37-${{ matrix.arch }} anda -p rpm

- name: Upload to Subatomic
run: |
subatomic-cli upload --prune \
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
terra${{ matrix.version }} anda-build/rpm/rpms/*
run: anda build -c anda-${{ matrix.version }}-${{ matrix.arch }} anda -p rpm

- name: Upload to Subatomic
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
packages:
description: "Packages to Build (pkg-a, pkg-b, ...)"
description: "Packages to Build"
required: true

jobs:
Expand Down
73 changes: 0 additions & 73 deletions .github/workflows/mass-rebuild.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/update-comps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- f38
paths:
- comps.xml
workflow_dispatch:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/update-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
fetch-depth: 0
ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }}

- name: Install SSH signing key
Expand All @@ -36,6 +36,14 @@ jobs:
git config user.email "[email protected]"
git config gpg.format "ssh"
git config user.signingkey "${{ runner.temp }}/signing_key"
git commit -S -a -m "Automatic Update: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')"
git push -u origin main
msg="bump(nightly): $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')"
git commit -S -a -m "$msg"
git format-patch HEAD^
git checkout f38
for file in *.patch; do
git apply $file || true
done
rm *.patch
git commit -S -a -m "$msg"
git push -u origin --all
fi
17 changes: 11 additions & 6 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# for each folder in ultramarine/
# if there is chkupdate.py
# run it every 2 hours
name: Automatically check for updates
on:
schedule:
Expand All @@ -17,7 +14,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
fetch-depth: 0
ssh-key: ${{ secrets.SSH_AUTHENTICATION_KEY }}

- name: Install SSH signing key
Expand All @@ -40,6 +37,14 @@ jobs:
git config user.email "[email protected]"
git config gpg.format "ssh"
git config user.signingkey "${{ runner.temp }}/signing_key"
git commit -S -a -m "Automatic Update: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')"
git push -u origin main
msg="bump: $(git status | grep modified | sed -r 's@.+/([^/]+)/[^/]+\n?@\1 @g' | tr -d '\n')"
git commit -S -a -m "$msg"
git format-patch HEAD^
git checkout f38
for file in *.patch; do
git apply $file || true
done
rm *.patch
git commit -S -a -m "$msg"
git push -u origin --all
fi

0 comments on commit 53cc322

Please sign in to comment.