feat(ci): improve workflows

This commit is contained in:
windowsboy111
2023-03-16 18:56:03 +08:00
parent 2b8d6207ea
commit df95dd3dfb
6 changed files with 33 additions and 92 deletions
-62
View File
@@ -1,62 +0,0 @@
name: Bootstrap Andaman and Subatomic (Fedora 38)
on:
workflow_dispatch:
jobs:
bootstrap:
strategy:
matrix:
version: ["38"]
arch: ["x86_64", "aarch64"]
fail-fast: true
runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }}
container:
image: fedora:38
options: --cap-add=SYS_ADMIN --privileged
steps:
- uses: actions/setup-go@v3
with:
go-version: "^1.19"
- name: Install repositories
run: |
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://github.com/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo
sudo dnf install -y mock createrepo_c rpm-build anda-mock-configs gcc curl wget git-core openssl-devel
- uses: actions/checkout@v3
with:
repository: FyraLabs/subatomic
set-safe-directory: true
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Anda
uses: actions-rs/cargo@v1
with:
command: install
args: anda
- name: Build Subatomic
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
anda build -c anda-38-${{ 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
- uses: actions/checkout@v3
with:
repository: FyraLabs/anda
- name: Build Andaman
run: anda build -c anda-38-${{ 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/*
+5 -12
View File
@@ -1,4 +1,4 @@
name: Bootstrap Andaman and Subatomic (Fedora 37)
name: Bootstrap Andaman and Subatomic
on:
workflow_dispatch:
@@ -7,12 +7,12 @@ jobs:
bootstrap:
strategy:
matrix:
version: ["37"]
version: ["38"]
arch: ["x86_64", "aarch64"]
fail-fast: true
runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }}
container:
image: fedora:37
image: fedora:38
options: --cap-add=SYS_ADMIN --privileged
steps:
- uses: actions/setup-go@v3
@@ -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
@@ -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: |
+9 -9
View File
@@ -10,25 +10,24 @@ jobs:
outputs:
build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }}
is_empty: ${{ steps.generate_build_matrix.outputs.is_empty }}
# check out the repo
container:
image: ghcr.io/terrapkg/builder:main
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
fetch-depth: 0
- run: git fetch
#- run: git checkout HEAD^
- name: Generate Build matrix
id: generate_build_matrix
# generate build matrix by checking out changes in anda/
run: |
build_matrix=$(find anda/ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u | jq -R -s -c 'split("\n")[:-1]')
# create build matrix with { changed_folders: [ "folder1", "folder2" ] }
echo "build_matrix=$build_matrix" >> $GITHUB_OUTPUT
#echo "::set-output name=build_matrix::$build_matrix"
git checkout -b mass-rebuild $(git rev-list HEAD | tail -n 1)
git merge --squash $(git branch --show-current)
anda ci >> $GITHUB_OUTPUT
build:
needs: manifest
strategy:
@@ -60,6 +59,7 @@ jobs:
if: steps.check_files.outputs.EXISTS == 'true'
with:
name: "${{ matrix.pkg }}pkg"
mockConfig: anda-${{ matrix.version }}-${{ matrix.arch }}
extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}"
andaRepo: https://github.com/terrapkg/subatomic-repos/raw/main/terra.repo
+3 -2
View File
@@ -3,6 +3,7 @@ name: Push comps updates
on:
push:
branches:
- main
- f38
paths:
- comps.xml
@@ -12,7 +13,7 @@ jobs:
update-comps:
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
image: ghcr.io/terrapkg/builder:main
steps:
- uses: actions/checkout@v3
- name: Push to subatomic
@@ -20,4 +21,4 @@ jobs:
subatomic-cli upload-comps \
--server https://subatomic.fyralabs.com \
--token ${{ secrets.SUBATOMIC_TOKEN }} \
terra38 comps.xml
terra37 comps.xml
+8 -2
View File
@@ -36,6 +36,12 @@ jobs:
git config user.email "raboneko@fyralabs.com"
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
git apply *.patch
rm *.patch
git commit -S -a -m $msg
git push -u origin f38
fi
+8 -5
View File
@@ -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:
@@ -11,7 +8,7 @@ jobs:
autoupdate:
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
image: ghcr.io/terrapkg/builder:main
options: --cap-add=SYS_ADMIN --privileged
steps:
- name: Checkout
@@ -40,6 +37,12 @@ jobs:
git config user.email "raboneko@fyralabs.com"
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')"
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
git apply *.patch
rm *.patch
git commit -S -a -m $msg
git push -u origin f38
fi