Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic release generation through Github actions #193

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bca81a5
Add build and release workflow
ronny-rentner Nov 11, 2022
029028e
Use all release artifacts including rpm for Github release
ronny-rentner Nov 13, 2022
bbbfbf9
Test: Do not persist credentials
ronny-rentner Dec 7, 2022
90aa334
Test: Release after sync
ronny-rentner Dec 7, 2022
eac2a71
Trigger notification
ronny-rentner Dec 9, 2022
b718803
Trigger notification
ronny-rentner Dec 9, 2022
8a49719
Test trigger build
ronny-rentner Dec 9, 2022
d484d5f
Test trigger build
ronny-rentner Dec 9, 2022
891d462
Test trigger build
ronny-rentner Dec 9, 2022
7d4c425
Trigger notification
ronny-rentner Dec 9, 2022
5313909
Test trigger build
ronny-rentner Dec 9, 2022
4bf1d07
Test trigger build
ronny-rentner Dec 9, 2022
3921596
Test trigger build
ronny-rentner Dec 9, 2022
aa49efc
Test trigger build
ronny-rentner Dec 9, 2022
6418309
Test trigger build
ronny-rentner Dec 9, 2022
1e84e9b
Test trigger build
ronny-rentner Dec 9, 2022
02ed796
Test trigger build
ronny-rentner Dec 9, 2022
cb5d6c9
Test trigger build
ronny-rentner Dec 9, 2022
1b36607
Test trigger build
ronny-rentner Dec 9, 2022
8105e6d
Test trigger build
ronny-rentner Dec 9, 2022
085a4db
Add build and release workflow
ronny-rentner Nov 13, 2022
292fe98
Use all release artifacts including rpm for Github release
ronny-rentner Nov 13, 2022
b912517
Fix sync workflow
ronny-rentner Nov 27, 2022
ec53c72
Merge branch 'lassekongo83:main' into synctest
ronny-rentner Feb 6, 2023
5e49953
Merge branch 'synctest'
ronny-rentner Feb 6, 2023
017f90b
Fix apt installation during build
ronny-rentner Feb 6, 2023
e28bd12
Fix apt
ronny-rentner Feb 6, 2023
328c8e1
Merge branch 'lassekongo83:main' into main
ronny-rentner Oct 25, 2024
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
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and release workflow

on:
workflow_dispatch: # on button click
workflow_call: # allow reuse from other workflows
push:
# branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-22.04
permissions:
contents: write

steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Update package manager
run:
sudo apt-get update

- name: Install dependencies
run: >
sudo apt-get install -y
ninja-build git meson sassc libvala-dev gobject-introspection libgtk-4-dev cmake valac gettext
equivs
alien

- name: Build package
run: make

- name: List artifacts
run: ls -Rl releases target

- name: Store release directory as artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ./releases

- name: Release
if: github.ref == 'refs/heads/main'
uses: ncipollo/release-action@v1
with:
name: ${{ github.event.repository.name }}-${{ steps.date.outputs.date }}
artifacts: "releases/*"
tag: nightly-${{ steps.date.outputs.date }}
prerelease: false
omitBody: true
artifactErrorsFailBuild: true
allowUpdates: true
replacesArtifacts: true
37 changes: 37 additions & 0 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sync fork with upstream

on:
workflow_dispatch: # on button click
schedule:
- cron: '30 1 * * *' # every day at 1:30 minutes

env:
UPSTREAM_URL: https://github.com/lassekongo83/adw-gtk3.git
UPSTREAM_BRANCH: main

jobs:
sync:
if: github.repository == 'ronny-rentner/adwaita-gtk3-gtk4-theme'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Show branch
run: echo "Syncing fork from $UPSTREAM_URL/$UPSTREAM_BRANCH to $GITHUB_REF"
- name: Sync latest commits from upstream repo
id: sync
run: |
git remote add upstream $UPSTREAM_URL
git fetch upstream $UPSTREAM_BRANCH
git rebase --autosquash --autostash upstream/$UPSTREAM_BRANCH
git push --force origin ${GITHUB_REF#refs/heads/}
git config --local --add safe.directory .
git push --porcelain --force origin ${GITHUB_REF#refs/heads/} | grep '\[up to date\]' && echo "release=yes" >> $GITHUB_OUTPUT
release:
needs: sync
if: ${{ success() && needs.sync.outputs.release == 'yes' }}
uses: ./.github/workflows/release.yml
secrets: inherit
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@

# Ignore meson build directory
build

*.swp
target
releases
debian/control
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "libadwaita"]
path = libadwaita
url = https://gitlab.gnome.org/GNOME/libadwaita.git
branch = libadwaita-1-2
90 changes: 90 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.ONESHELL:
SHELL := /bin/bash
.SHELLFLAGS += -O globstar -e

MAKEFLAGS += --always-make

DIR := ${CURDIR}
BUILD_DIR := ${DIR}/build
TARGET_DIR := ${DIR}/target
TARGET_THEMES_DIR := ${TARGET_DIR}/share/themes
RELEASE_DIR := ${DIR}/releases
VERSION := $(shell date +'%Y-%m-%d')

GTK4_DIR := ${DIR}/libadwaita
GTK4_BUILD_DIR := ${GTK4_DIR}/_build
GTK4_PATCH_DIR := ${TARGET_THEMES_DIR}/adw-gtk3/gtk-4.0
GTK4_PATCH_SRC_DIR := ${GTK4_BUILD_DIR}/src/stylesheet
GTK4_DARK_PATCH_DIR := ${TARGET_THEMES_DIR}/adw-gtk3-dark/gtk-4.0
GTK4_ASSETS_DIR := ${GTK4_DIR}/src/stylesheet/assets

DEBIAN_DIR := ${DIR}/debian
DEBIAN_CONTROL := ${DEBIAN_DIR}/control
DEBIAN_VERSION := $(shell date +'%Y.%m.%d')

all: clean build gtk4build gtk4patch release debian rpm

update:
git pull
git submodule update --recursive --remote

build:
meson -Dprefix="${TARGET_DIR}" ${BUILD_DIR}
ninja -C ${BUILD_DIR} install

gtk4build:
cd ${GTK4_DIR}
meson . ${GTK4_BUILD_DIR}
ninja -C ${GTK4_BUILD_DIR}

gtk4patch:
#light
mkdir -p ${GTK4_PATCH_DIR}
cp ${GTK4_PATCH_SRC_DIR}/defaults-light.css ${GTK4_PATCH_DIR}
cp -R ${GTK4_ASSETS_DIR} ${GTK4_PATCH_DIR}
echo "@import 'defaults-light.css';\n" |cat - ${GTK4_PATCH_SRC_DIR}/base.css >${GTK4_PATCH_DIR}/gtk.css
#dark
mkdir -p ${GTK4_DARK_PATCH_DIR}
cp ${GTK4_PATCH_SRC_DIR}/defaults-dark.css ${GTK4_DARK_PATCH_DIR}
cp -R ${GTK4_ASSETS_DIR} ${GTK4_DARK_PATCH_DIR}
echo "@import 'defaults-dark.css';\n" |cat - ${GTK4_PATCH_SRC_DIR}/base.css >${GTK4_DARK_PATCH_DIR}/gtk.css

debian: build gtk4build gtk4patch
mkdir -p ${BUILD_DIR}/debian
cd ${BUILD_DIR}/debian
cp ${DEBIAN_CONTROL}.in ${DEBIAN_CONTROL}
# Remove trailing newline character in control file
sed -i -z 's/\n$$//' ${DEBIAN_CONTROL}
sed -i -z 's/__VERSION__/${DEBIAN_VERSION}/' ${DEBIAN_CONTROL}
$(date +'%Y-%m-%d')
LEN=`echo ${TARGET_DIR} |wc -c`
for f in ${TARGET_DIR}/**; do
if [ -d $${f} ]; then
continue
fi
echo " $${f} `dirname /usr/$${f:$${LEN}}`" >>${DEBIAN_CONTROL}
done
equivs-build ${DEBIAN_CONTROL}
mkdir -p ${RELEASE_DIR}
cp *.deb ${RELEASE_DIR}
cd ${DIR}

rpm:
cd ${RELEASE_DIR}
fakeroot alien --to-rpm *.deb
cd ${DIR}

release:
mkdir -p ${RELEASE_DIR}
cd ${TARGET_THEMES_DIR}
tar -zcvf ${RELEASE_DIR}/adw-gtk3-gtk4-${VERSION}.tgz *

clean: gtk4clean debianclean
rm -rf "${TARGET_DIR}"
rm -rf "${BUILD_DIR}"

gtk4clean:
rm -rf ${DIR}/libadwaita/_build

debianclean:
rm -f ${DEBIAN_CONTROL}
28 changes: 28 additions & 0 deletions debian/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
Homepage: https://github.com/lassekongo83/adw-gtk3
Standards-Version: 3.9.2

Package: adwaita-gtk3-gtk4-theme
Version: __VERSION__
Maintainer: Ronny Rentner <[email protected]>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Multi-Arch: <one of: foreign|same|allowed>
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
Readme: /dev/null
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Links: <pair of space-separated paths; First is path symlink points at, second is filename of link>
# <more pairs, if there's more than one file to include. Notice the starting space>
Description: Adwaita GTK3 + GTK4 theme
This theme resembles Adwaita styles for GTK3 and GTK4 to achieve unified looks across all GTK applications in Gnome.
Files:
1 change: 1 addition & 0 deletions libadwaita
Submodule libadwaita added at 359c13