Skip to content

Commit

Permalink
update flatpak repo creation
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Nov 14, 2024
1 parent 22054cf commit b7cf345
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/continous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@ jobs:
uses: softprops/action-gh-release@v2
with:
tag_name: continuous
name: Continuous
name: "🚧 Development Build (Continuous)"
files: "futr.flatpak"
prerelease: true
body: "This is an automated continuous release."
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 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/flatpak-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Update Flatpak Repository

on:
workflow_run:
workflows: ["Flatpak Tagged Release", "Flatpak Build and Release"]
types:
- completed

permissions:
contents: read
pages: write
id-token: write

jobs:
update-repo:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Flatpak
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
- name: Download Flatpak Bundle
uses: actions/download-artifact@v4
with:
name: flatpak-bundle
path: ./

- name: Create/Update Repository
run: |
mkdir -p repo
flatpak build-update-repo --generate-static-deltas repo
if [ -f "futr.flatpak" ]; then
flatpak build-import-bundle repo futr.flatpak
fi
- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload Repository
uses: actions/upload-pages-artifact@v3
with:
path: 'repo'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Flatpak Tagged Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
flatpak-build-and-release:
name: Flatpak Build and Release
runs-on: ubuntu-latest
steps:
# Use the same steps as continuous.yml until the "Update appdata.xml" step
# Copy all previous steps...

- name: Update appdata.xml for tagged release
run: |
VERSION=${GITHUB_REF#refs/tags/v}
TODAY=$(date +%Y-%m-%d)
# Add new release entry at the top of releases section
sed -i "/<releases>/a \ <release version=\"$VERSION\" date=\"$TODAY\">\n <description>\n <p>Release version $VERSION</p>\n </description>\n </release>" flatpak/com.futrnostr.futr.appdata.xml
- name: Build Flatpak
run: ./build-flatpak.sh

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: "futr.flatpak"
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions flatpak/com.futrnostr.futr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ sdk: org.kde.Sdk
command: futr
copy-icon: true

x-flatpak-refs:
- type: runtime
name: org.kde.Platform
branch: 5.15-23.08
- type: repository
url: https://futrnostr.github.io/futr-flatpak/repo
branch: master

finish-args:
- --share=network
- --share=ipc
Expand Down

0 comments on commit b7cf345

Please sign in to comment.