GitHub CI #313
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: GitHub CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: "59 15 * * *" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: 'bash -Eeuo pipefail -x {0}' | |
jobs: | |
build-trixie: | |
strategy: | |
matrix: | |
devbuild: ['enabled', 'disabled'] | |
runs-on: ubuntu-latest | |
container: docker.io/library/debian:trixie-slim | |
name: Build Trixie | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Lingmo repo | |
run: | | |
apt-get update -y && apt-get upgrade -y && apt-get install -y apt-transport-https ca-certificates | |
echo "deb [trusted=yes] https://raw.githubusercontent.com/LingmoOS/lingmo-nightly-build/refs/heads/main nightly experimental" >> /etc/apt/sources.list.d/lingmo-rolling.list | |
apt-get update | |
- name: Update Apt and Install packages | |
run: | | |
apt-get update -y && apt-get upgrade -y | |
apt-get install -y sudo equivs curl git devscripts lintian build-essential automake autotools-dev cmake g++ --no-install-recommends | |
- name: Install PowerShell | |
run: | | |
curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/powershell_7.4.3-1.deb_amd64.deb -o powershell.deb | |
apt-get install -y ./powershell.deb | |
rm powershell.deb | |
- name: Build Lingmo Nightly | |
if: ${{ matrix.devbuild == 'enabled' }} | |
run: | | |
git config --global http.sslVerify false | |
git config --global advice.detachedHead false | |
chmod +x ./build.ps1 | |
pwsh -c "./build.ps1 -BuildFromGit" | |
- name: Build Lingmo Using Tag | |
if: ${{ matrix.devbuild == 'disabled' }} | |
run: | | |
git config --global http.sslVerify false | |
git config --global advice.detachedHead false | |
chmod +x ./build.ps1 | |
pwsh -c "./build.ps1" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Lingmo Artifacts With Nightly ${{ matrix.devbuild }} | |
path: BuildArtifacts | |
compression-level: 9 # maximum compression | |
- name: Prepare envs | |
if: ${{ !(github.event_name == 'pull_request') && matrix.devbuild == 'enabled' }} | |
run: | | |
sudo apt update && sudo apt install reprepro gnupg | |
echo "${{ secrets.GPG_SIGN_KEY }}" >> key.key | |
gpg --import key.key | |
- name: Clone & Update repo | |
if: ${{ !(github.event_name == 'pull_request') && matrix.devbuild == 'enabled' }} | |
run: | | |
git clone https://github.com/LingmoOS/lingmo-nightly-build.git pkg_site | |
DEB_FILE_DIR="$(pwd)/BuildArtifacts" | |
cd pkg_site | |
git checkout --orphan latest_branch | |
bash ./add_debs.sh $DEB_FILE_DIR $(pwd) "nightly" | |
git config --global user.email "[email protected]" | |
git config --global user.name "Lingmo Automation Packer" | |
git add . && git commit -m "Update Packages By Actions" | |
git branch -D main | |
git branch -m main | |
git reflog expire --expire=now --all && git gc --prune=now --aggressive | |
cd .. | |
- name: Push changes | |
if: ${{ !(github.event_name == 'pull_request') && matrix.devbuild == 'enabled' }} | |
uses: ad-m/github-push-action@9870d48124da805820c70ebc6ba563c715551019 | |
with: | |
github_token: ${{ secrets.API_GITHUB_TOKEN }} | |
repository: "LingmoOS/lingmo-nightly-build" | |
directory: "./pkg_site" | |
branch: 'main' | |
force: true |