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
46 changes: 46 additions & 0 deletions .github/dependencies.apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
appstream-compose
attr
automake
autopoint
bison
dbus
debugedit
desktop-file-utils
docbook-xsl
elfutils
flatpak
fuse3
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
libfuse3-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
xmlto
xsltproc
54 changes: 5 additions & 49 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,60 +33,16 @@ 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 findutils
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 \
libfuse3-dev \
fuse3 \
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
$(xargs < .github/dependencies.apt.txt)

- name: Configure flatpak-builder
run: meson setup --wrap-mode nodownload ${CONFIG_OPTS} ${BUILDDIR} .
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
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:
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 flatpak-builder
run: meson setup --wrap-mode nodownload ${BUILDDIR} .

- name: Build flatpak-builder with Meson
run: meson compile -C ${BUILDDIR}

- name: Verify tag matches meson version
run: |
VERSION=$(meson introspect --projectinfo ${BUILDDIR} | jq -r .version)
TAG="${GITHUB_REF_NAME}"

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

if [ "$VERSION" != "$TAG" ]; then
echo "ERROR: Tag does not match meson 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: Create dist tarball
run: |
meson dist --include-subprojects -C ${BUILDDIR}
ls -lh ${BUILDDIR}/meson-dist/

- 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: builddir/meson-dist/*
immutableCreate: true
44 changes: 20 additions & 24 deletions MAINT.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,30 @@

- Update the `NEWS`
- Update version number in `meson.build`.
- 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`, with all options enabled.
- Create a tarball with `meson dist --include-subprojects -C builddir`.
The tarball is created from a clean checkout. It is produced as
`builddir/meson-dist/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 locally with all meson options enabled.
- Once CI on PR and local builds are successful merge the PR.

The next step is to create the tag.

## 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.

```
git tag -s -m "<MAJOR.MINOR.PATCH>" <MAJOR.MINOR.PATCH>
```

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.
NOTE. The tags are created in the `MAJOR.MINOR.PATCH` format eg.
`1.4.6` (WITHOUT the `v*` prefix).

Then the `flatpak-builder-$VERSION.tar.xz` tarball is to be attahced.
This is the primary way downstreams consume Flatpak builder.
- Push the tag.

```
git push origin $TAG
```

NOTE: GitHub releases are set as _immutable_, so please be careful.
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