Skip to content

Commit f5ab0f4

Browse files
committed
feat: pipeline workflows
1 parent 9fa1fe0 commit f5ab0f4

File tree

7 files changed

+107
-71
lines changed

7 files changed

+107
-71
lines changed

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Auto Release Factory
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'docs/**'
10+
- '.gitignore'
11+
- 'LICENSE'
12+
13+
jobs:
14+
factory-build:
15+
name: Build, Tag & Publish
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: 📥 Checkout Code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: 🔧 Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: 🏗️ Execute Build Script
30+
run: |
31+
chmod +x build.sh
32+
./build.sh
33+
34+
- name: 📦 Package Artifacts
35+
run: |
36+
echo "[CI] Zipping artifacts..."
37+
cd output
38+
zip -r ../Manjaro-WSL-Distro.zip ./*
39+
cd ..
40+
41+
- name: 🏷️ Calculate Next Version
42+
id: tag_version
43+
uses: mathieudutour/[email protected]
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
default_bump: patch
47+
release_branches: main
48+
49+
- name: 🚀 Create Release
50+
uses: softprops/action-gh-release@v1
51+
with:
52+
files: Manjaro-WSL-Distro.zip
53+
tag_name: ${{ steps.tag_version.outputs.new_tag }}
54+
name: Release ${{ steps.tag_version.outputs.new_tag }}
55+
body: ${{ steps.tag_version.outputs.changelog }}
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
FROM manjarolinux/base:latest
22

3-
LABEL maintainer="Lucas <[email protected]>"
3+
LABEL maintainer="Lucas"
44
LABEL description="Manjaro RootFS Generator for WSL2"
55

6-
# 1. Basic Setup and Packages
76
RUN pacman -Syu --noconfirm && \
8-
pacman -S --noconfirm base-devel git vim zsh sudo wget fastfetch && \
7+
pacman -S --noconfirm base-devel git vim zsh sudo wget fastfetch unzip && \
98
pacman -Sc --noconfirm
109

11-
# 2. User Configuration
1210
RUN useradd -m -G wheel -s /bin/zsh manjaro && \
1311
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/wheel
1412

15-
# 3. ZSH Configuration
16-
# We create a simple .zshrc for the manjaro user
1713
USER manjaro
1814
RUN echo 'autoload -Uz compinit promptinit' > ~/.zshrc && \
1915
echo 'compinit' >> ~/.zshrc && \
2016
echo 'promptinit' >> ~/.zshrc && \
2117
echo 'prompt walters' >> ~/.zshrc && \
2218
echo 'alias ll="ls -la"' >> ~/.zshrc
2319

24-
# Switch back to root to copy system configurations if needed
2520
USER root
2621

27-
# 4. Inject WSL configuration
2822
COPY config/wsl.conf /etc/wsl.conf
2923

30-
# 5. Final Adjustments
24+
COPY config/wsl-distribution.conf /etc/wsl-distribution.conf
25+
26+
RUN mkdir -p /usr/lib/wsl
27+
COPY config/manjaro.ico /usr/lib/wsl/manjaro.ico
28+
# --------------------------------------------------
29+
3130
USER manjaro
3231
WORKDIR /home/manjaro
3332

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ Automated pipeline to generate a custom Manjaro Linux distribution for Windows S
66

77
* WSL2 enabled
88
* Docker Desktop installed and running
9-
* PowerShell
109

1110
## Build Process
1211

1312
1. Clone this repository
14-
2. Open PowerShell in the project root directory
13+
2. Open your terminal in the project root directory
1514
3. Run the build script:
1615

17-
```powershell
18-
.\build.ps1
16+
```sh
17+
./build.sh
1918
```
2019

2120
After completion, the artifacts will be available in the `output/` directory:
@@ -30,7 +29,7 @@ After completion, the artifacts will be available in the `output/` directory:
3029
3. Run `Manjaro.exe` to register the distribution in WSL
3130
4. Validate the installation:
3231

33-
```powershell
32+
```sh
3433
wsl -d Manjaro
3534
```
3635

build.ps1

Lines changed: 0 additions & 57 deletions
This file was deleted.

build.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
4+
IMAGE_NAME="manjaro-wsl-clean"
5+
CONTAINER_NAME="manjaro-wsl-export-temp"
6+
OUTPUT_DIR="output"
7+
ICONS_ZIP_URL="https://github.com/yuk7/wsldl/releases/latest/download/icons.zip"
8+
9+
echo -e "\e[36m[INFO] Iniciando build v3.0 (Smart - No Wine)...\e[0m"
10+
11+
rm -rf "$OUTPUT_DIR"
12+
mkdir -p "$OUTPUT_DIR"
13+
14+
echo -e "\e[36m[INFO] Buildando imagem Docker...\e[0m"
15+
docker build -t "$IMAGE_NAME" .
16+
17+
echo -e "\e[36m[INFO] Criando container para exportação...\e[0m"
18+
docker rm -f "$CONTAINER_NAME" 2>/dev/null || true
19+
docker create --name "$CONTAINER_NAME" "$IMAGE_NAME" > /dev/null
20+
21+
echo -e "\e[36m[INFO] Exportando RootFS...\e[0m"
22+
docker export "$CONTAINER_NAME" | gzip > "$OUTPUT_DIR/rootfs.tar.gz"
23+
24+
echo -e "\e[36m[INFO] Baixando Launcher Manjaro oficial (pré-iconizado)...\e[0m"
25+
curl -L -o "$OUTPUT_DIR/icons.zip" "$ICONS_ZIP_URL"
26+
27+
echo -e "\e[36m[INFO] Extraindo Manjaro.exe...\e[0m"
28+
unzip -q -j "$OUTPUT_DIR/icons.zip" "Manjaro.exe" -d "$OUTPUT_DIR"
29+
30+
rm "$OUTPUT_DIR/icons.zip"
31+
docker rm -f "$CONTAINER_NAME" > /dev/null
32+
33+
echo -e "\e[32m------------------------------------------------\e[0m"
34+
echo -e "\e[32mSUCESSO! Build finalizado.\e[0m"
35+
echo -e "Arquivos gerados em: ./$OUTPUT_DIR"
36+
echo -e "\e[32m------------------------------------------------\e[0m"

config/manjaro.ico

4.19 KB
Binary file not shown.

config/wsl-distribution.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[shortcut]
2+
icon = /usr/lib/wsl/manjaro.ico

0 commit comments

Comments
 (0)