Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 76 additions & 8 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y \
appstream \
desktop-file-utils \
pkg-config \
libxcb1-dev \
Expand All @@ -389,9 +390,9 @@ jobs:
run: |
set -euo pipefail
mkdir -p dist
# Backward compatibility for older tags that used non-standard categories.
sed 's/VersionControl;/RevisionControl;/g' assets/linux/gitcomet.desktop > dist/gitcomet.desktop
desktop-file-validate dist/gitcomet.desktop
cp assets/linux/dev.gitcomet.GitComet.desktop dist/dev.gitcomet.GitComet.desktop
desktop-file-validate dist/dev.gitcomet.GitComet.desktop
appstreamcli validate --no-net flatpak/dev.gitcomet.GitComet.metainfo.xml

- name: Package tar.gz
run: |
Expand All @@ -417,8 +418,8 @@ jobs:
mkdir -p "${pkg_root}/usr/share/icons/hicolor/512x512/apps"

install -m755 target/release/gitcomet "${pkg_root}/usr/bin/gitcomet"
install -m644 dist/gitcomet.desktop "${pkg_root}/usr/share/applications/gitcomet.desktop"
install -m644 assets/gitcomet-512.png "${pkg_root}/usr/share/icons/hicolor/512x512/apps/gitcomet.png"
install -m644 dist/dev.gitcomet.GitComet.desktop "${pkg_root}/usr/share/applications/dev.gitcomet.GitComet.desktop"
install -m644 assets/gitcomet-512.png "${pkg_root}/usr/share/icons/hicolor/512x512/apps/dev.gitcomet.GitComet.png"

{
echo "Package: gitcomet"
Expand All @@ -440,8 +441,8 @@ jobs:
appdir="dist/AppDir"
mkdir -p "${appdir}/usr/bin"
install -m755 target/release/gitcomet "${appdir}/usr/bin/gitcomet"
install -m644 dist/gitcomet.desktop "${appdir}/gitcomet.desktop"
install -m644 assets/gitcomet-512.png "${appdir}/gitcomet.png"
install -m644 dist/dev.gitcomet.GitComet.desktop "${appdir}/dev.gitcomet.GitComet.desktop"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assets path

install -m644 assets/gitcomet-512.png "${appdir}/dev.gitcomet.GitComet.png"

{
echo '#!/usr/bin/env bash'
Expand Down Expand Up @@ -470,6 +471,45 @@ jobs:
if-no-files-found: error
retention-days: 7

build_flatpak:
name: Build Flatpak artifact
runs-on: ubuntu-latest
timeout-minutes: 120
needs: prepare
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-24.08
options: --privileged
env:
TAG: ${{ needs.prepare.outputs.tag }}
VERSION: ${{ needs.prepare.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.prepare.outputs.tag }}
fetch-depth: 0

- name: Build Flatpak bundle
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: dev.gitcomet.GitComet.flatpak
manifest-path: flatpak/dev.gitcomet.GitComet.local.yaml
cache-key: flatpak-builder-${{ needs.prepare.outputs.tag }}
upload-artifact: false

- name: Stage Flatpak artifact
run: |
set -euo pipefail
mkdir -p dist
mv dev.gitcomet.GitComet.flatpak "dist/gitcomet-v${VERSION}-linux-x86_64.flatpak"

- name: Upload Flatpak artifact
uses: actions/upload-artifact@v4
with:
name: flatpak-release-artifacts
path: dist/*.flatpak
if-no-files-found: error
retention-days: 7

build_macos:
name: Build macOS artifacts (${{ matrix.target_platform }})
runs-on: ${{ matrix.runs_on }}
Expand Down Expand Up @@ -667,7 +707,7 @@ jobs:
name: Attach assets and checksums to GitHub release
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [prepare, build_windows, build_linux, build_macos]
needs: [prepare, build_windows, build_linux, build_flatpak, build_macos]
env:
TAG: ${{ needs.prepare.outputs.tag }}
VERSION: ${{ needs.prepare.outputs.version }}
Expand All @@ -691,6 +731,11 @@ jobs:
path: dist/linux
merge-multiple: true

- uses: actions/download-artifact@v8
with:
name: flatpak-release-artifacts
path: dist/flatpak

- uses: actions/download-artifact@v8
with:
pattern: macos-release-artifacts-*
Expand All @@ -703,6 +748,7 @@ jobs:
mkdir -p dist/release
find dist/windows -maxdepth 1 -type f -exec cp -f {} dist/release/ \;
find dist/linux -maxdepth 1 -type f -exec cp -f {} dist/release/ \;
find dist/flatpak -maxdepth 1 -type f -exec cp -f {} dist/release/ \;
find dist/macos -maxdepth 1 -type f -exec cp -f {} dist/release/ \;
file_count="$(find dist/release -maxdepth 1 -type f | wc -l | tr -d '[:space:]')"
if [ "${file_count}" = "0" ]; then
Expand All @@ -711,6 +757,28 @@ jobs:
fi
ls -lah dist/release

- name: Generate source tarball
run: |
set -euo pipefail
git archive \
--format=tar.gz \
--prefix="gitcomet-v${VERSION}-source/" \
"$TAG" \
-o "dist/release/gitcomet-v${VERSION}-source.tar.gz"

- name: Render Flathub manifest assets
run: |
set -euo pipefail
source_tar="dist/release/gitcomet-v${VERSION}-source.tar.gz"
source_sha256="$(sha256sum "$source_tar" | awk '{print $1}')"
source_url="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}/gitcomet-v${VERSION}-source.tar.gz"
scripts/render-flathub-manifest.sh \
--source-url "$source_url" \
--source-sha256 "$source_sha256" \
--output "dist/release/dev.gitcomet.GitComet.yaml"
cp flatpak/cargo-sources.json dist/release/cargo-sources.json
cp flatpak/flathub.json dist/release/flathub.json

- name: Generate Homebrew cask and formula
run: |
set -euo pipefail
Expand Down
Loading
Loading