Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
feat: simplify build
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinfall committed May 12, 2024
1 parent a046ce4 commit 6d60612
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "ClearWSL Weekly Build"
name: "ClearWSL Build"

on:
push:
branches: [ main ]
branches: [main]
# Trigger only when Makefile is changed
paths: ['Makefile']
paths: ["Makefile"]
workflow_dispatch:
schedule:
# Trigger on the 1st day of every month at 12:00 UTC
Expand All @@ -13,30 +13,27 @@ on:
jobs:
build:
runs-on: ubuntu-latest
# Skip build with [ci skip] in commit
if: "! contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
ref: 'main'
ref: "main"
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- run: mkdir -p release
- name: install dependencies
run: sudo apt install -y curl libarchive-tools jq tar unzip xz-utils
run: sudo apt install -y curl libarchive-tools jq tar unzip
- name: build package & make hash
run: |
sudo make
sudo make clean
sha512sum Clear.zip > Clear.zip.sha512
mv Clear.zip* release/
sudo make
sudo make clean
sha512sum Clear.zip > Clear.zip.sha512
mv Clear.zip* release/
- name: save release as artifact
uses: actions/upload-artifact@v4
with:
retention-days: 10
name: Clear-packed.zip
path: release
path: "release/*"
- name: upload artifact to release
uses: ncipollo/release-action@v1
with:
Expand Down
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ $(OUT_ZIP): ziproot
@echo -e '\e[1;31mBuilding $(OUT_ZIP)\e[m'
cd ziproot; bsdtar -a -cf ../$(OUT_ZIP) *

ziproot: Launcher.exe rootfs.tar.gz
ziproot: Launcher.exe rootfs.tar.xz
@echo -e '\e[1;31mBuilding ziproot...\e[m'
mkdir ziproot
cp Launcher.exe ziproot/${LNCR_EXE}
cp rootfs.tar.gz ziproot/
cp rootfs.tar.xz ziproot/

exe: Launcher.exe
Launcher.exe: icons.zip
Expand All @@ -30,26 +30,13 @@ icons.zip:
@echo -e '\e[1;31mDownloading icons.zip...\e[m'
$(DLR) $(DLR_FLAGS) $(LNCR_ZIP_URL) -o icons.zip

rootfs.tar.gz: rootfs
@echo -e '\e[1;31mBuilding rootfs.tar.xz...\e[m'
cd rootfs; sudo tar -zcpf ../rootfs.tar.gz `sudo ls`
sudo chown `id -un` rootfs.tar.gz

rootfs: base.tar.xz
@echo -e '\e[1;31mBuilding rootfs...\e[m'
mkdir rootfs
sudo tar -xpf base.tar.xz -C rootfs
sudo chmod +x rootfs

base.tar.xz:
rootfs.tar.xz:
@echo -e '\e[1;31mDownloading base.tar.gz...\e[m'
$(DLR) $(DLR_FLAGS) $(BASE_URL) -o base.tar.xz
$(DLR) $(DLR_FLAGS) $(BASE_URL) -o rootfs.tar.xz

clean:
@echo -e '\e[1;31mCleaning files...\e[m'
-rm -r ziproot
-rm Launcher.exe
-rm icons.zip
-rm rootfs.tar.gz
-sudo rm -r rootfs
-rm base.tar.xz
-rm rootfs.tar.xz

0 comments on commit 6d60612

Please sign in to comment.