ci: add actions for CI and release automation

This commit is contained in:
Jari Vetoniemi 2021-05-20 10:35:18 +09:00 committed by Jari Vetoniemi
parent 4b7b483bd6
commit d5683f3633
3 changed files with 75 additions and 2 deletions

41
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install build deps
run: sudo apt-get install libcairo2-dev libpango1.0-dev libxinerama-dev libwayland-dev wayland-protocols libxkbcommon-dev
- name: make
run: make PREFIX=install EXTRA_WARNINGS=-Werror
- name: make install
run: make install PREFIX=install
osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: install build deps
run: brew update; brew install make pkg-config
- name: make
run: sh build-osx.sh EXTRA_WARNINGS=-Werror clients curses
doxygen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install doxygen
run: sudo apt-get install doxygen
- name: make doxygen
run: make doxygen
- uses: actions/upload-artifact@v2
with:
name: docs
path: html

26
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Release CI
on:
push:
tags:
- '*.*.*'
sign:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: import pgp key
run: echo -n "$GPG_KEY" | base64 --decode | gpg --import
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: make sign
run: make sign
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
- name: release
uses: softprops/action-gh-release@v1
with:
files: bemenu-*.tar.gz.asc
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,12 +6,13 @@ libdir ?= /lib
mandir ?= /share/man/man1
GIT_SHA1 = $(shell git rev-parse HEAD 2>/dev/null || printf 'nogit')
GIT_TAG = $(shell git tag --points-at HEAD 2>/dev/null || cat VERSION)
MAKEFLAGS += --no-builtin-rules
WARNINGS = -Wall -Wextra -Wpedantic -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \
-Wfloat-equal -Wcast-align -Wpointer-arith -Wchar-subscripts -Warray-bounds=2 -Wno-unknown-warning-option
override CFLAGS ?= -g -O2 $(WARNINGS)
override CFLAGS ?= -g -O2 $(WARNINGS) $(EXTRA_WARNINGS)
override CFLAGS += -std=c99
override CPPFLAGS ?= -D_FORTIFY_SOURCE=2
override CPPFLAGS += -DBM_VERSION=\"$(VERSION)\" -DBM_PLUGIN_VERSION=\"$(VERSION)-$(GIT_SHA1)\" -DINSTALL_LIBDIR=\"$(PREFIX)$(libdir)\"
@ -145,6 +146,11 @@ doxygen:
cp -R doxygen/doxygen-qmi-style/navtree html
cp -R doxygen/doxygen-qmi-style/search html/search
sign:
test "x$(GIT_TAG)" = "x$(VERSION)"
git archive --prefix="$(VERSION)/" -o "bemenu-$(VERSION).tar.gz" "$(GIT_TAG)"
gpg --default-key "$(GPG_KEY_ID)" --armor --detach-sign "bemenu-$(VERSION).tar.gz"
clean:
$(RM) -r *.dSYM # OSX generates .dSYM dirs with -g ...
$(RM) $(pkgconfigs) $(libs) $(bins) $(renderers) $(mans) *.a *.so.*
@ -154,4 +160,4 @@ clean:
.DELETE_ON_ERROR:
.PHONY: all clean install install-base install-pkgconfig install-include install-libs install-lib-symlinks \
install-man install-bins install-renderers install-curses install-wayland install-x11 \
doxygen clients curses x11 wayland
doxygen sign clients curses x11 wayland