fix appdata flatpak template #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Cache Flatpak installations | |
id: flatpak-cache | |
uses: actions/[email protected] | |
with: | |
path: /var/lib/flatpak | |
key: ${{ runner.os }}-flatpak-${{ hashFiles('flatpak/**') }} | |
restore-keys: | | |
${{ runner.os }}-flatpak- | |
- name: Install Flatpak and Flatpak Builder | |
if: steps.flatpak-cache.outputs.cache-hit != 'true' | |
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: Cache GHC and Cabal | |
id: haskell-cache | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.ghcup | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
cabal.project.local | |
key: ${{ runner.os }}-ghc-${{ hashFiles('**/*.cabal', 'cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-ghc- | |
- name: Set up Haskell | |
if: steps.haskell-cache.outputs.cache-hit != 'true' | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: '9.6.6' | |
cabal-version: '3.10.3.0' | |
- 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/[email protected] | |
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 }} |