Beef-Nightly/.forgejo/workflows/build.yml

98 lines
2.4 KiB
YAML
Raw Normal View History

2024-09-11 23:46:57 +02:00
on:
workflow_dispatch:
2024-09-11 23:53:00 +02:00
schedule:
- cron: '0 12 * * *'
2024-09-11 23:46:57 +02:00
jobs:
Build:
steps:
2024-09-12 00:25:19 +02:00
2024-09-11 23:46:57 +02:00
- name: Install apt packages
run: |
apt update
2024-09-12 00:25:19 +02:00
apt install git cmake software-properties-common --yes
2024-09-11 23:46:57 +02:00
- name: Add llvm package
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh 18
2024-09-12 00:25:19 +02:00
- name: Restore Beef repository
2024-09-12 00:34:55 +02:00
id: beef-repo-restore
2024-09-12 00:25:19 +02:00
uses: actions/cache/restore@v4
with:
path: |
2024-09-12 10:03:45 +02:00
Beef
2024-09-12 00:25:19 +02:00
key: BeefRepository
2024-09-12 00:33:22 +02:00
- name: Pull Beef changes
2024-09-12 00:34:55 +02:00
if: steps.beef-repo-restore.outputs.cache-hit == 'true'
2024-09-12 00:25:19 +02:00
run: |
git -C Beef pull
2024-09-11 23:46:57 +02:00
- name: Clone Beef repository
2024-09-12 14:02:15 +02:00
if: steps.beef-repo-restore.outputs.cache-hit != 'true'
2024-09-12 00:28:06 +02:00
run: |
git clone https://code.booklordofthe.dev/Extern/Beef Beef
2024-09-12 00:25:19 +02:00
2024-09-11 23:46:57 +02:00
- name: Run build.sh
run: |
2024-09-12 00:25:19 +02:00
Beef/bin/build.sh
- name: Cache repository
2024-09-12 10:45:10 +02:00
if: steps.restore-beef-repository.outputs.cache-hit != 'true'
2024-09-12 00:34:55 +02:00
id: beef-repo-save
2024-09-12 00:25:19 +02:00
uses: actions/cache/save@v4
with:
path: |
2024-09-12 10:03:45 +02:00
Beef
2024-09-12 00:25:19 +02:00
key: BeefRepository
2024-09-12 16:54:17 +02:00
2024-09-12 16:53:04 +02:00
- name: Create build artifact
run: |
mkdir artifact
2024-09-12 17:29:08 +02:00
mkdri artifact/BeefBuild
cp -Lr Beef/IDE/dist artifact/BeefBuild/bin
cp -Lr Beef/BeefLibs artifact/BeefBuild/BeefLibs
2024-09-12 16:54:17 +02:00
- name: Upload build artifact
2024-09-12 17:06:27 +02:00
uses: actions/upload-artifact@v3
2024-09-12 16:54:17 +02:00
with:
name: BeefBuild
path: artifact
2024-09-12 17:51:07 +02:00
Package:
steps:
2024-09-12 20:53:21 +02:00
- name: Setup directories
run: |
mkdir BeefDeb
mkdir BeefDeb/DEBIAN
mkdir BeefDeb/opt
mkdir BeefDeb/opt/BeefBuild
mkdir BeefDeb/usr
mkdir BeefDeb/usr/bin
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: BeefBuild
path: BeefDeb/opt/BeefBuild
- name: Create control file
run: |
cat > BeefDeb/DEBIAN/control << EOF
Package: beefbuild
Version: 0.43.4.20240909
Section: Beef
Priority: optional
Architecture: amd64
Homepage: https://www.beeflang.org/
Maintainer: Booklordofthedings <Booklordofthedings@tutanota.com>
Description: A compiler for beef. Use BeefBuild -help to get more information
EOF
2024-09-12 17:51:07 +02:00