-
Notifications
You must be signed in to change notification settings - Fork 2
124 lines (102 loc) · 4.13 KB
/
continous.yml
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
name: Flatpak Build and Release
on:
push:
branches: ["master"]
permissions:
contents: write
jobs:
flatpak-build-and-release:
name: Flatpak Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Flatpak and Flatpak Builder
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y flathub org.kde.Platform//5.15-23.08 org.kde.Sdk//5.15-23.08
- name: Set up Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: '9.6.6'
cabal-version: '3.10.3.0'
- name: Cache Cabal packages
uses: actions/cache@v4.1.2
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-ghc-9.6.6-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-ghc-9.6.6-cabal-
- name: Update Cabal package list
run: cabal update
- name: Install Build Tools
run: |
sudo apt-get update
sudo apt-get install -y autoconf autogen automake libtool
- name: Install Qt5 Dependencies
run: |
sudo apt-get install -y qtdeclarative5-dev libqt5quick5 qt5-image-formats-plugins qttools5-dev-tools qtbase5-dev
- name: Install secp256k1 Library
run: |
git clone https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
git checkout v0.5.1 && \
./autogen.sh && \
./configure --enable-module-schnorrsig --enable-module-extrakeys --enable-module-ecdh --enable-experimental --enable-module-recovery && \
make && \
sudo make install && \
cd ..
- name: Set Library Path
run: echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf && sudo ldconfig
- name: Build with Cabal
run: cabal build
- name: Update appdata.xml
run: |
TODAY=$(date +%Y-%m-%d)
APPDATA="flatpak/com.futrnostr.futr.appdata.xml"
# Copy template if appdata.xml doesn't exist
if [ ! -f "$APPDATA" ]; then
cp flatpak/com.futrnostr.futr.appdata.xml.template "$APPDATA"
fi
# Remove any existing continuous release entry
sed -i '/<release version="continuous"/,/<\/release>/d' "$APPDATA"
# Add new continuous release entry at the top of releases section
sed -i "/<releases>/a \ <release version=\"continuous\" date=\"$TODAY\" type=\"development\">\n <description>\n <p>Development build from master branch</p>\n <p>Commit: ${{ github.sha }}</p>\n </description>\n </release>" "$APPDATA"
- name: Build Flatpak
run: ./build-flatpak.sh
- name: Upload appdata.xml
uses: actions/upload-artifact@v4
with:
name: appdata-xml
path: flatpak/com.futrnostr.futr.appdata.xml
retention-days: 7
- name: Upload Flatpak Bundle
uses: actions/upload-artifact@v4
with:
name: flatpak-bundle
path: futr.flatpak
retention-days: 7
- name: Delete existing release and tag
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
tag_name: continuous
delete_release: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: continuous
name: "🚧 Development Build (Continuous)"
files: "futr.flatpak"
prerelease: true
draft: false
body: |
⚠️ This is an automated development build from the latest master branch.
This build is not recommended for production use.
Last updated: ${{ github.event.head_commit.timestamp }}
token: ${{ secrets.GITHUB_TOKEN }}