-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: automate releases and refactor ci
- Loading branch information
Showing
5 changed files
with
211 additions
and
135 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt update | ||
RUN apt upgrade -y | ||
|
||
# Install dependencies | ||
RUN apt install -y --no-install-recommends \ | ||
gcc clang \ | ||
ca-certificates \ | ||
desktop-file-utils \ | ||
fuse3 \ | ||
gettext \ | ||
git \ | ||
gnome-desktop-testing \ | ||
gtk-doc-tools \ | ||
libcap2-bin \ | ||
libflatpak-dev \ | ||
libfontconfig1-dev \ | ||
libfuse3-dev \ | ||
libgdk-pixbuf-2.0-dev \ | ||
libgeoclue-2-dev \ | ||
libglib2.0-dev \ | ||
libjson-glib-dev \ | ||
libpipewire-0.3-dev \ | ||
libportal-dev \ | ||
libsystemd-dev \ | ||
libtool \ | ||
llvm \ | ||
python3-gi \ | ||
shared-mime-info | ||
|
||
# Install meson | ||
RUN apt install -y --no-install-recommends meson | ||
|
||
# Install pytest | ||
RUN apt install -y --no-install-recommends \ | ||
python3-pytest \ | ||
python3-pytest-xdist \ | ||
python3-dbusmock \ | ||
python3-dbus |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Create build container | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # Weekly | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build and push container | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
file: .github/workflows/Containerfile | ||
tags: ghcr.io/${{ github.repository_owner }}/xdg-desktop-portal-build:latest |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Release new version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version (default: auto)" | ||
preRelease: | ||
description: "Is this a pre-release? (true/false, default: auto)" | ||
dryRun: | ||
description: Dry Run | ||
default: false | ||
|
||
jobs: | ||
release: | ||
name: Build and publish a release | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/${{ github.repository_owner }}/xdg-desktop-portal-build:latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Configure git user | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global --add safe.directory $GITHUB_WORKSPACE | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update translation files | ||
if: ${{ !fromJSON(github.event.inputs.dryRun) }} | ||
run: | | ||
meson setup . _build | ||
meson compile -C _build/ xdg-desktop-portal-update-po | ||
git add po/*po | ||
git commit -m "Update po files" | ||
git push | ||
git clean -fxd | ||
- name: Build xdg-desktop-portal | ||
if: ${{ !fromJSON(github.event.inputs.dryRun) }} | ||
run: | | ||
meson setup . _build | ||
meson dist -C _build | ||
- name: Extract release information | ||
env: | ||
releaseVersion: ${{ github.event.inputs.version }} | ||
preRelease: ${{ github.event.inputs.preRelease }} | ||
run: | | ||
# Extract the release version | ||
if [ -z $releaseVersion ]; then | ||
releaseVersion=`perl -0777nE 'print $& if /(?<=Changes in ).*/' NEWS` | ||
fi | ||
echo "releaseVersion=$releaseVersion" | tee -a $GITHUB_ENV | ||
# Extract the changelog | ||
{ | ||
echo "releaseChangelog<<EOF" | ||
perl -0777nE 'print $& if /(?<=\n\n).*?(?=\n\n)/sg' NEWS | ||
echo -e "\nEOF" | ||
} | tee -a $GITHUB_ENV | ||
# Check if version is a pre-release | ||
if [ -z $preRelease ]; then | ||
preRelease=$((`echo $releaseVersion | cut -d '.' -f2` % 2)) | ||
fi | ||
{ | ||
echo -n "preRelease=" | ||
if [ $preRelease = 1 ]; then | ||
echo "true"; | ||
else | ||
echo "false"; | ||
fi | ||
} | tee -a $GITHUB_ENV | ||
- name: Tag release | ||
if: ${{ !fromJSON(github.event.inputs.dryRun) }} | ||
run: | | ||
git tag $releaseVersion | ||
git push --tags | ||
- name: Create release | ||
if: ${{ !fromJSON(github.event.inputs.dryRun) }} | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: ${{ env.releaseVersion }} | ||
body: ${{ env.releaseChangelog }} | ||
prerelease: ${{ env.preRelease }} | ||
artifacts: _build/meson-dist/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
# Steps for doing a xdg-desktop-portal release | ||
|
||
- git clean -fxd | ||
- meson setup . _build && meson compile -C _build/ xdg-desktop-portal-update-po | ||
- git add po/*po && git commit -m "Update po files" | ||
- git clean -fxd | ||
- add content to NEWS | ||
- git commit -m <version> | ||
- git push origin main | ||
- meson setup . _build -Ddocbook-docs=enabled | ||
- meson dist -C _build | ||
- git tag <version> | ||
- git push origin refs/tags/<version> | ||
- upload tarball to github as release | ||
- edit release, copy NEWS section in | ||
- update portal api docs in the gh-pages branch | ||
- bump version in meson.build | ||
- git commit -m "Post-release version bump" | ||
- git push origin main | ||
- Update SECURITY.md if this is a new stable release | ||
- Update .github/ISSUE_TEMPLATE/bug-report.yml if this is a new stable release | ||
- Make sure the version in `meson.build` is correct | ||
- Add your changelog to the `NEWS` file | ||
- Run the "Release new version" GitHub Action | ||
- The options are taken from the last `NEWS` entry by default, you may override them if needed | ||
- Bump version in `meson.build` | ||
- Update `SECURITY.md` if this is a new stable release | ||
- Update `.github/ISSUE_TEMPLATE/bug-report.yml` if this is a new stable release |