Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/dependencies.apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
appstream-compose
attr
automake
autopoint
bison
dbus
desktop-file-utils
docbook-xsl
elfutils
flatpak
gettext
git
git-lfs
gobject-introspection
gtk-doc-tools
libappstream-dev
libarchive-dev
libarchive-tools
libattr1-dev
libcap-dev
libcurl4-gnutls-dev
libdconf-dev
libdw-dev
libelf-dev
libflatpak-dev
libfuse-dev
libgirepository1.0-dev
libglib2.0-dev
libgpgme11-dev
libjson-glib-dev
libostree-dev
libpolkit-agent-1-dev
libpolkit-gobject-1-dev
libseccomp-dev
libsystemd-dev
libxml2-utils
libyaml-dev
ostree
patch
shared-mime-info
socat
xmlto
xsltproc
85 changes: 15 additions & 70 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@ jobs:
name: Build with gcc and test
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0 attr automake appstream-compose gettext autopoint bison dbus gtk-doc-tools \
libfuse-dev ostree libostree-dev libarchive-dev libcap-dev libattr1-dev libdw-dev libelf-dev \
libjson-glib-dev shared-mime-info desktop-file-utils libpolkit-agent-1-dev libpolkit-gobject-1-dev \
libseccomp-dev libsystemd-dev libxml2-utils libgpgme11-dev gobject-introspection \
libgirepository1.0-dev libappstream-dev libdconf-dev clang socat flatpak \
libcurl4-gnutls-dev libflatpak-dev libyaml-dev elfutils git patch libarchive-tools \
docbook-xsl xmlto xsltproc git-lfs
- name: Check out flatpak
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y findutils
sudo apt-get install -y $(xargs < .github/dependencies.apt.txt)
- name: configure
run: ./autogen.sh
env:
Expand All @@ -55,20 +50,15 @@ jobs:
name: Build with clang
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0 attr automake appstream-compose gettext autopoint bison dbus gtk-doc-tools \
libfuse-dev ostree libostree-dev libarchive-dev libcap-dev libattr1-dev libdw-dev libelf-dev \
libjson-glib-dev shared-mime-info desktop-file-utils libpolkit-agent-1-dev libpolkit-gobject-1-dev \
libseccomp-dev libsystemd-dev libxml2-utils libgpgme11-dev gobject-introspection \
libgirepository1.0-dev libappstream-dev libdconf-dev clang flatpak \
libcurl4-gnutls-dev libflatpak-dev libyaml-dev elfutils git patch libarchive-tools \
docbook-xsl xmlto xsltproc git-lfs
- name: Check out flatpak
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y findutils clang
sudo apt-get install -y $(xargs < .github/dependencies.apt.txt)
- name: configure
# We disable introspection because it fails with clang: https://bugzilla.redhat.com/show_bug.cgi?id=1543295
run: ./autogen.sh --disable-introspection
Expand All @@ -93,59 +83,14 @@ jobs:
CONFIG_OPTS: -Dinstalled_tests=true

steps:
- name: Check out flatpak-builder
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
${{ matrix.compiler }} \
attr \
automake \
autopoint \
appstream-compose \
bison \
debugedit \
dbus \
desktop-file-utils \
elfutils \
flatpak \
gettext \
git \
gobject-introspection \
gtk-doc-tools \
libappstream-dev \
libarchive-dev \
libattr1-dev \
libcap-dev \
libcurl4-gnutls-dev \
libdconf-dev \
libdw-dev \
libelf-dev \
libflatpak-dev \
libfuse-dev \
libgirepository1.0-dev \
libglib2.0-dev \
libgpgme11-dev \
libjson-glib-dev \
libostree-dev \
libpolkit-agent-1-dev \
libpolkit-gobject-1-dev \
libseccomp-dev \
libsystemd-dev \
libxml2-utils \
libyaml-dev \
meson \
ostree \
patch \
shared-mime-info \
socat \
libarchive-tools \
docbook-xsl \
xmlto \
xsltproc \
git-lfs

- name: Check out flatpak-builder
uses: actions/checkout@v4
sudo apt-get install -y meson debugedit ${{ matrix.compiler }}
sudo apt-get install -y $(xargs < .github/dependencies.apt.txt)

- name: Configure flatpak-builder
run: meson setup --wrap-mode nodownload ${CONFIG_OPTS} ${BUILDDIR} .
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Release flatpak-builder
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
DEBIAN_FRONTEND: noninteractive
BUILDDIR: builddir

jobs:
release:
name: Build and publish release
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout repository
# 6.0.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
submodules: true
persist-credentials: false

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y findutils
sudo apt-get install -y \
gcc \
perl \
jq \
$(xargs < .github/dependencies.apt.txt)

- name: Configure with autotools
run: ./autogen.sh

- name: Build
run: make -j$(getconf _NPROCESSORS_ONLN)

- name: Verify tag matches version
run: |
VERSION=$(./configure --version | head -n1 | awk '{print $NF}')
TAG="${GITHUB_REF_NAME}"

echo "Autotools version: $VERSION"
echo "Git tag: $TAG"

if [ "$VERSION" != "$TAG" ]; then
echo "ERROR: Tag does not match autotools version"
exit 1
fi

echo "releaseVersion=$VERSION" >> $GITHUB_ENV

- name: Extract changelog from NEWS
run: |
VERSION="${GITHUB_REF_NAME}"

{
echo "releaseChangelog<<EOF"
perl -0777 -ne "print \$1 if /Changes in \Q$VERSION\E\n=+\n\n(.*?)(?=\nChanges in|\Z)/s" NEWS
echo ""
echo "EOF"
} >> $GITHUB_ENV

- name: Determine prerelease
run: |
VERSION="${GITHUB_REF_NAME}"
MINOR=$(echo "$VERSION" | cut -d. -f2)

if [ $((MINOR % 2)) -eq 1 ]; then
echo "preRelease=true" >> $GITHUB_ENV
else
echo "preRelease=false" >> $GITHUB_ENV
fi

- name: Check distribution
run: make distcheck

- name: Create dist tarball
run: |
make dist
ls -lh flatpak-builder-*.tar.xz

- name: Compute tarball checksum
run: |
TARBALL=$(ls flatpak-builder-*.tar.xz)
echo "releaseTarball=$TARBALL" >> $GITHUB_ENV
sha256sum "$TARBALL" > "$TARBALL.sha256sum"

- name: Create GitHub release
# 1.21.0
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd
with:
tag: ${{ env.releaseVersion }}
name: ${{ env.releaseVersion }}
body: ${{ env.releaseChangelog }}
prerelease: ${{ env.preRelease }}
artifacts: ${{ env.releaseTarball }},${{ env.releaseTarball }}.sha256sum
immutableCreate: true
41 changes: 18 additions & 23 deletions MAINT.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,28 @@

- Update the `NEWS`
- Update version number in `meson.build` and `configure.ac`.
- Open a PR titled "Release $VERSION" with the above to see if CI passes.
- Merge the PR to the target branch.
- Check out the target branch, pull the above change locally and make
sure the submodules are correct and checked out.
- Build with `meson` and `make`, with all options enabled.
- Create a tarball with `make dist`. The tarball is created from a
clean checkout. It is produced as `flatpak-builder-$VERSION.tar.xz`.
- Verify the project is buildable using the tarball. The tarball MUST
contain the submodule files.
- Open a PR titled "Release $VERSION" with the above changes.
- Build with `meson` and `make`, with all options enabled, locally.
- Once CI on PR and local builds are successful merge the PR.

## Tagging

- The tags are created in the `MAJOR.MINOR.PATCH` format eg. `1.4.6`
(WITHOUT the `v*` prefix).
- Ideally the tags should be signed and annotated tags. Optionally
git-evtag can be used.
- The tag message should have the changelog and the checksum of the
tarball that will be attached to GitHub releases.
- Once the tag is pushed, a GitHub release from that tag is to be
created.
- Checkout the target branch and pull the latest changes from above.
- Create a signed and annotated tag using either git or git-evtag.

The release tag is the new tag, the title is `VERSION` and the release
body is the message from the tag. Additional notifications and details
can be documented to the release body.
```
git tag -s -m "<MAJOR.MINOR.PATCH>" <MAJOR.MINOR.PATCH>
```

Then the `flatpak-builder-$VERSION.tar.xz` tarball is to be attahced.
This is the primary way downstreams consume Flatpak builder.
NOTE. The tags are created in the `MAJOR.MINOR.PATCH` format eg.
`1.4.6` (WITHOUT the `v*` prefix).

- Push the tag.

NOTE: GitHub releases are set as _immutable_, so please be careful.
```
git push origin $TAG
```

Once the tag is pushed, the GitHub release workflow will rebuild and
run tests on it. If successful, it will then automatically create a
GitHub release from the tag with the dist tarballs attached.
Loading