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

fix: build packages failed: bump openwrt-sdk-action and init setup for apk #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
35 changes: 26 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,44 @@ name: Build network profiles
on:
push:
branches: [master]
workflow_dispatch:

jobs:
# Build all packages for x86_64
# use latest branch of openwrt with opkg to produce feed at https://feed.libremesh.org/profiles
# use main branch of openwrt with apk to produce feed at https://feed.libremesh.org/apk/profiles
# NOTE: this doesn't sign packages for apk
build:
name: Build profiles ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- { version: main, output_path: 'apk/'}
- { version: openwrt-23.05, output_path: ''}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build packages
uses: openwrt/gh-action-sdk@v5
- name: Build packages ${{ matrix.version }}
uses: openwrt/gh-action-sdk@v7
env:
ARCH: "x86_64"
EXTRA_FEEDS: "src-git|libremesh|https://github.com/libremesh/lime-packages.git"
ARCH: "x86_64-${{ matrix.version }}"
# needed? EXTRA_FEEDS: "src-git|libremesh|https://github.com/libremesh/lime-packages.git"
FEEDNAME: "profiles"
IGNORE_ERRORS: "n m y"
KEY_BUILD: "${{ secrets.KEY_BUILD }}"
KEY_BUILD: "${{ matrix.version != 'main' && secrets.KEY_BUILD || '' }}"
INDEX: 1
NO_DEFAULT_FEEDS: 1
NO_REFRESH_CHECK: 1
NO_SHFMT_CHECK: 1

- name: Upload packages to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: libremesh/lime-feed
external_repository: a-gave/lime-feed
publish_dir: bin/packages/x86_64/profiles/
destination_dir: profiles
destination_dir: ${{ matrix.output_path }}profiles
29 changes: 12 additions & 17 deletions profile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,19 @@ PROFILE_COMMUNITY=$(lastword $(filter-out $(PROFILE_NAME),$(subst /, ,$(CURDIR))
PKG_NAME:=profile-$(PROFILE_COMMUNITY)-$(PROFILE_NAME)
PKG_MAINTAINER?=$(PROFILE_MAINTAINER)

# from https://github.com/openwrt/luci/blob/master/luci.mk
# from https://github.com/openwrt/luci/blob/master/luci.mk
# default package version follow this scheme:
# [year].[day_of_year].[seconds_of_day]~[commit_short_hash] eg. 24.322.80622~a403707
PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \
if svn info >/dev/null 2>/dev/null; then \
revision="svn-r$$(LC_ALL=C svn info | sed -ne 's/^Revision: //p')"; \
elif git log -1 >/dev/null 2>/dev/null; then \
revision="svn-r$$(LC_ALL=C git log -1 | sed -ne 's/.*git-svn-id: .*@\([0-9]\+\) .*/\1/p')"; \
if [ "$$revision" = "svn-r" ]; then \
set -- $$(git log -1 --format="%ct %h" --abbrev=7); \
secs="$$(($$1 % 86400))"; \
yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
revision="$$(printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2")"; \
fi; \
else \
revision="unknown"; \
fi; \
echo "$$revision" \
if git log -1 >/dev/null 2>/dev/null; then \
set -- $$(git log -1 --format="%ct %h" --abbrev=7); \
secs="$$(($$1 % 86400))"; \
yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
printf '%s.%05d~%s' "$$yday" "$$secs" "$$2"; \
else \
echo "0"; \
fi; \
)))
PKG_RELEASE?=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

Expand All @@ -35,7 +30,7 @@ define Package/$(PKG_NAME)
CATEGORY:=LibreMesh
TITLE:=$(if $(PROFILE_TITLE),$(PROFILE_TITLE),Profile $(PROFILE_COMMUNITY) $(PROFILE_NAME))
DEPENDS:=+lime-system $(PROFILE_DEPENDS)
VERSION:=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION))
VERSION:=$(PKG_VERSION)
PKGARCH:=all
URL:=https://github.com/libremesh/network-profiles/
endef
Expand Down