-
Notifications
You must be signed in to change notification settings - Fork 2
153 lines (131 loc) · 4.28 KB
/
Copy pathrelease.yml
File metadata and controls
153 lines (131 loc) · 4.28 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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-deb:
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install dependencies
run: npm install
- name: Build Tauri .deb
run: npm run tauri build -- --bundles deb
- name: Rename .deb file
run: |
VERSION="${{ needs.check-release.outputs.version }}"
DEB_FILE=$(find src-tauri/target/release/bundle/deb -name "*.deb" -type f)
mv "$DEB_FILE" "Klia-Store-${VERSION}.deb"
- name: Upload .deb artifact
uses: actions/upload-artifact@v4
with:
name: deb-package
path: Klia-Store-*.deb
build-flatpak:
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-22.04
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-47
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: Klia-Store-${{ needs.check-release.outputs.version }}.flatpak
manifest-path: io.github.N3kosempai.klia-store.yml
cache-key: flatpak-builder-${{ github.sha }}
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v4
with:
name: flatpak-package
path: Klia-Store-*.flatpak
create-release:
needs: [check-release, build-deb, build-flatpak]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download .deb artifact
uses: actions/download-artifact@v4
with:
name: deb-package
- name: Download Flatpak artifact
uses: actions/download-artifact@v4
with:
name: flatpak-package
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check-release.outputs.version }}
name: Klia Store ${{ needs.check-release.outputs.version }}
draft: false
prerelease: false
body: |
## Klia Store ${{ needs.check-release.outputs.version }}
### Installation
**Debian/Ubuntu (.deb):**
```bash
sudo dpkg -i Klia-Store-${{ needs.check-release.outputs.version }}.deb
```
**Flatpak:**
```bash
flatpak install Klia-Store-${{ needs.check-release.outputs.version }}.flatpak
flatpak run io.github.N3kosempai.klia-store
```
### Changes
${{ github.event.head_commit.message }}
files: |
Klia-Store-*.deb
Klia-Store-*.flatpak