Skip to content

Commit

Permalink
Merge branch 'master' into issue/280
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Oct 3, 2024
2 parents 3dd666a + 769ab66 commit b209f43
Show file tree
Hide file tree
Showing 2,699 changed files with 63,096 additions and 29,943 deletions.
2 changes: 1 addition & 1 deletion .github/actions/sync-repository/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
sudo apt-get update -yq
echo "syncAptVersion=sshfs-$(apt-cache policy sshfs | grep -oP '(?<=Candidate:\s)(.+)')" >> $GITHUB_ENV
- name: Cache Apt packages
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-apt
with:
path: ~/.aptcache
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/web/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Cache Python environment
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-python
with:
path: web/.venv
Expand Down
58 changes: 48 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,38 @@ on:
- 'Makefile'
- 'package'
jobs:
lint:
name: Lint source
runs-on: ubuntu-latest
steps:
- name: Cache shfmt
uses: actions/cache@v4
with:
path: /usr/local/bin/shfmt
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
- name: Install shfmt
shell: bash
run: |
install_dir=/usr/local/bin
if ! [[ -f "$install_dir"/shfmt ]]; then
shfmt_version=v3.2.1
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$install_dir"/shfmt \
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
sudo chmod a+x "$install_dir"/shfmt
fi
- uses: actions/checkout@v4
- name: Lint
run: make lint
build:
name: Build and package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install toltecmk
Expand All @@ -41,17 +66,17 @@ jobs:
run: make package
timeout-minutes: 15
- name: Save packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packages
path: release
- name: Save packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: .build/package/build/rmall/src/release
- name: Save repo
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: repo
path: .build/package/dist/rmall
Expand All @@ -60,14 +85,19 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
id: download
with:
name: repo
- uses: Eeems-Org/run-in-remarkable-action@v1
with:
setup: |
set -ex
wget https://github.com/Eeems-Org/sysfs_preload/releases/download/1.0.0/packages.zip -O /tmp/packages.zip
unzip /tmp/packages.zip -d /tmp
opkg install /tmp/rmall/sysfs_preload_1.0.0-1_rmall.ipk
wget https://github.com/timower/rM2-stuff/releases/download/v0.1.2/rm2display.ipk -O /tmp/rm2display.ipk
opkg install /tmp/rm2display.ipk
echo "src/gz local-rmall file:///opt/tmp/src" > /opt/etc/opkg.conf.d/16-local.conf
run: |
set -ex
Expand All @@ -80,14 +110,14 @@ jobs:
opkg remove --force-removal-of-dependent-packages liboxide
path: ${{ steps.download.outputs.download-path }}
release:
needs: [build,test]
needs: [build,test,lint]
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
path: .build
Expand All @@ -99,12 +129,20 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: https://sentry.eeems.codes
- name: Setup Sentry CLI
uses: mathieu-bour/setup-sentry-cli@v1
uses: mathieu-bour/setup-sentry-cli@v2
with:
version: latest
url: https://sentry.eeems.codes
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
organization: ${{ secrets.SENTRY_ORG }}
project: ${{ secrets.SENTRY_PROJECT }}
- name: Upload debug artifacts (debug)
if: ${{ !runner.debug }}
run: sentry-cli debug-files upload --include-sources .
env:
SENTRY_LOG_LEVEL: info
- name: Upload debug artifacts
if: ${{ runner.debug }}
run: sentry-cli debug-files upload --include-sources .
env:
SENTRY_LOG_LEVEL: debug
48 changes: 0 additions & 48 deletions .github/workflows/nix.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Build web
uses: ./.github/actions/web
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: 'web/dist/'
deploy:
Expand All @@ -38,4 +38,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Build web
uses: ./.github/actions/web
- name: Save web
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: web
path: web/dist
Expand Down
118 changes: 71 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,76 @@ MAKEFLAGS := --jobs=$(shell nproc)
DIST=$(CURDIR)/release
BUILD=$(CURDIR)/.build


ifneq ($(filter sentry,$(FEATURES)),)
OBJ += sentry
RELOBJ += $(DIST)/opt/lib/libsentry.so
DEFINES += 'DEFINES+="SENTRY"'
DEFINES += DEFINES+="SENTRY"
endif

OBJ += $(BUILD)/oxide/Makefile

clean:
rm -rf $(DIST) $(BUILD)
clean-base:
rm -rf $(DIST) $(BUILD)/oxide

release: clean build $(RELOBJ)
mkdir -p $(DIST)
clean: clean-base
rm -rf $(BUILD)

release: clean-base build $(DIST)
# Force sentry makefile to regenerate so that install targets get when being build in toltecmk
cd $(BUILD)/oxide/shared/sentry && make qmake
# Force liboxide makefile to regenerate so that install targets get when being build in toltecmk
cd $(BUILD)/oxide/shared/liboxide && make qmake
INSTALL_ROOT=$(DIST) $(MAKE) --output-sync=target -C $(BUILD)/oxide install

build: $(BUILD) $(OBJ)
build: $(OBJ)
$(MAKE) --output-sync=target -C $(BUILD)/oxide all

package: REV="~r$(shell git rev-list --count HEAD).$(shell git rev-parse --short HEAD)"
package:
package: version.txt $(DIST) $(BUILD)/package/oxide.tar.gz
toltecmk \
--verbose \
-w $(BUILD)/package/build \
-d $(BUILD)/package/dist \
$(BUILD)/package
cp -a $(BUILD)/package/dist/rmall/*.ipk $(DIST)

version.txt:
if [ -d .git ];then \
echo $(REV) > version.txt; \
else \
echo "~manual" > version.txt; \
fi;

$(DIST):
mkdir -p $(DIST)

$(BUILD):
mkdir -p $(BUILD)

$(BUILD)/.nobackup: $(BUILD)
touch $(BUILD)/.nobackup

$(BUILD)/oxide: $(BUILD)/.nobackup
mkdir -p $(BUILD)/oxide

$(BUILD)/oxide/Makefile: $(BUILD)/oxide
cd $(BUILD)/oxide && qmake -r $(DEFINES) $(CURDIR)

$(BUILD)/package:
mkdir -p $(BUILD)/package
rm -rf $(BUILD)/package/build

$(BUILD)/package/package: $(BUILD)/package
sed "s/~VERSION~/`cat version.txt`/" ./package > $(BUILD)/package/package

PKG_OBJ = oxide.pro Makefile
PKG_OBJ += $(wildcard applications/**)
PKG_OBJ += $(wildcard assets/**)
PKG_OBJ += $(wildcard interfaces/**)
PKG_OBJ += $(wildcard qmake/**)
PKG_OBJ += $(wildcard shared/**)
PKG_OBJ += $(wildcard tests/**)

$(BUILD)/package/oxide.tar.gz: $(BUILD)/package/package $(PKG_OBJ)
rm -f $(BUILD)/package/oxide.tar.gz
tar \
--exclude='$(CURDIR)/.git' \
--exclude='$(BUILD)' \
Expand All @@ -53,43 +92,28 @@ package:
interfaces \
qmake \
shared \
tests \
oxide.pro \
Makefile
toltecmk \
--verbose \
-w $(BUILD)/package/build \
-d $(BUILD)/package/dist \
$(BUILD)/package
mkdir -p $(DIST)
cp -a $(BUILD)/package/dist/rmall/*.ipk $(DIST)

sentry: $(BUILD)/sentry/libsentry.so

$(BUILD):
mkdir -p $(BUILD)

$(BUILD)/.nobackup: $(BUILD)
touch $(BUILD)/.nobackup

$(BUILD)/oxide: $(BUILD)/.nobackup
mkdir -p $(BUILD)/oxide

$(BUILD)/oxide/Makefile: $(BUILD)/oxide
cd $(BUILD)/oxide && qmake -r $(DEFINES) $(CURDIR)/oxide.pro

$(BUILD)/sentry/libsentry.so: $(BUILD)/.nobackup
cd shared/sentry && cmake -B $(BUILD)/sentry/src \
-DBUILD_SHARED_LIBS=ON \
-DSENTRY_INTEGRATION_QT=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSENTRY_PIC=OFF \
-DSENTRY_BACKEND=breakpad \
-DSENTRY_BREAKPAD_SYSTEM=OFF \
-DSENTRY_EXPORT_SYMBOLS=ON \
-DSENTRY_PTHREAD=ON
cd shared/sentry && cmake --build $(BUILD)/sentry/src --parallel
cd shared/sentry && cmake --install $(BUILD)/sentry/src --prefix $(BUILD)/sentry --config RelWithDebInfo

$(DIST)/opt/lib/libsentry.so: sentry
mkdir -p $(DIST)/opt/lib
cp -a $(BUILD)/sentry/lib/libsentry.so $(DIST)/opt/lib/
SRC_FILES = $(shell find -name '*.sh' | grep -v shared/sentry)
SRC_FILES += package

lint:
shfmt \
-d\
-s \
-i 4 \
-bn \
-sr \
$(SRC_FILES)

format:
shfmt \
-l \
-w \
-s \
-i 4 \
-bn \
-sr \
$(SRC_FILES)
Loading

0 comments on commit b209f43

Please sign in to comment.