-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (113 loc) · 4.39 KB
/
Copy pathrelease.yml
File metadata and controls
134 lines (113 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release Build
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '.gitignore'
workflow_dispatch:
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for [release] in commit message
id: check
run: |
COMMIT_MSG=$(git log -1 --pretty=%B)
if echo "$COMMIT_MSG" | grep -q "\[release\]"; then
echo "should_release=true" >> $GITHUB_OUTPUT
# Extract version from package.json
VERSION=$(grep -oP '"version":\s*"\K[^"]+' package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Release triggered with version $VERSION"
else
echo "should_release=false" >> $GITHUB_OUTPUT
echo "No [release] tag found in commit message"
fi
build-flatpak:
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-22.04
steps:
# 1. Limpieza estándar (sin redimensionar particiones, es más seguro)
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v4
# 2. EL TRUCO MAESTRO: Redirigir Flatpak al disco de 75GB (/mnt)
- name: Redirect Flatpak Storage to /mnt
run: |
echo "Espacio antes del truco:"
df -h
# Crear carpeta en el disco gigante
sudo mkdir -p /mnt/flatpak-storage
sudo chown -R $USER:$USER /mnt/flatpak-storage
# Crear la estructura local
mkdir -p ~/.local/share
# Crear el enlace simbólico: Todo lo que vaya a ~/.local/share/flatpak
# realmente se guardará en /mnt/flatpak-storage (75GB libres)
ln -s /mnt/flatpak-storage ~/.local/share/flatpak
echo "Enlace creado. Flatpak usará /mnt."
# 3. Instalación de herramientas
- name: Install Flatpak & Builder
run: |
sudo add-apt-repository ppa:flatpak/stable -y
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
flatpak-builder --version
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# 4. Instalar SDKs (Ahora irán al disco gigante)
- name: Install Runtime & SDKs
run: |
flatpak install --user -y flathub org.gnome.Sdk//49 org.gnome.Platform//49
flatpak install --user -y flathub org.freedesktop.Sdk.Extension.rust-stable//25.08
flatpak install --user -y flathub org.freedesktop.Sdk.Extension.node20//25.08
# 5. Compilar (Usando --sandbox para aislar)
- name: Build Flatpak
run: |
# Importante: XDG_DATA_HOME fuerza a usar nuestras rutas locales
export XDG_DATA_HOME=$HOME/.local/share
flatpak-builder --user --repo=repo --force-clean build-dir io.github.N3kosempai.klia-store.yml
flatpak build-bundle repo Klia-Store-${{ needs.check-release.outputs.version }}.flatpak io.github.N3kosempai.klia-store
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v4
with:
name: flatpak-package
path: Klia-Store-*.flatpak
create-release:
needs: [check-release, build-flatpak]
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download Flatpak artifact
uses: actions/download-artifact@v4
with:
name: flatpak-package
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.check-release.outputs.version }}
name: Release v${{ needs.check-release.outputs.version }}
draft: false
prerelease: false
files: |
Klia-Store-*.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}