Skip to content

Commit

Permalink
Merge pull request #747 from davidgiven/ab
Browse files Browse the repository at this point in the history
Convert to the latest ab.
  • Loading branch information
davidgiven authored Mar 29, 2024
2 parents df83b55 + 2bccdcc commit 968b90d
Show file tree
Hide file tree
Showing 15 changed files with 536 additions and 385 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,61 +46,61 @@ jobs:
name: ${{ github.event.repository.name }}.${{ github.sha }}
path: fluxengine/FluxEngine.pkg

build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW32
install: >-
diffutils
make
mingw-w64-i686-binutils
mingw-w64-i686-fmt
mingw-w64-i686-gcc
mingw-w64-i686-libusb
mingw-w64-i686-nsis
mingw-w64-i686-pkg-config
mingw-w64-i686-protobuf
mingw-w64-i686-python
mingw-w64-i686-sqlite3
mingw-w64-i686-wxWidgets
mingw-w64-i686-zlib
mingw-w64-i686-png2ico
vim
zip
- name: update-protobuf
run: |
pacman -U --noconfirm https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-protobuf-21.9-1-any.pkg.tar.zst
- uses: actions/checkout@v2
with:
repository: 'davidgiven/fluxengine'
path: 'fluxengine'
- uses: actions/checkout@v2
with:
repository: 'davidgiven/fluxengine-testdata'
path: 'fluxengine-testdata'
- name: build
run: MAGICK_TIME_LIMIT=100 make -j`nproc` -C fluxengine
#build-windows:
# runs-on: windows-latest
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: msys2/setup-msys2@v2
# with:
# update: true
# msystem: MINGW32
# install: >-
# diffutils
# make
# mingw-w64-i686-binutils
# mingw-w64-i686-fmt
# mingw-w64-i686-gcc
# mingw-w64-i686-libusb
# mingw-w64-i686-nsis
# mingw-w64-i686-pkg-config
# mingw-w64-i686-protobuf
# mingw-w64-i686-python
# mingw-w64-i686-sqlite3
# mingw-w64-i686-wxWidgets
# mingw-w64-i686-zlib
# mingw-w64-i686-png2ico
# vim
# zip
# - name: update-protobuf
# run: |
# pacman -U --noconfirm https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-protobuf-21.9-1-any.pkg.tar.zst
# - uses: actions/checkout@v2
# with:
# repository: 'davidgiven/fluxengine'
# path: 'fluxengine'
# - uses: actions/checkout@v2
# with:
# repository: 'davidgiven/fluxengine-testdata'
# path: 'fluxengine-testdata'
# - name: build
# run: MAGICK_TIME_LIMIT=100 make -j`nproc` -C fluxengine

- name: nsis
run: |
cd fluxengine
strip fluxengine.exe -o fluxengine-stripped.exe
strip fluxengine-gui.exe -o fluxengine-gui-stripped.exe
makensis -v2 -nocd -dOUTFILE=fluxengine-installer.exe extras/windows-installer.nsi
# - name: nsis
# run: |
# cd fluxengine
# strip fluxengine.exe -o fluxengine-stripped.exe
# strip fluxengine-gui.exe -o fluxengine-gui-stripped.exe
# makensis -v2 -nocd -dOUTFILE=fluxengine-installer.exe extras/windows-installer.nsi

- name: zip
run: |
cd fluxengine
zip -9 fluxengine-windows.zip fluxengine.exe fluxengine-gui.exe upgrade-flux-file.exe brother120tool.exe brother240tool.exe FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex fluxengine-installer.exe
# - name: zip
# run: |
# cd fluxengine
# zip -9 fluxengine-windows.zip fluxengine.exe fluxengine-gui.exe upgrade-flux-file.exe brother120tool.exe brother240tool.exe FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex fluxengine-installer.exe

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}.${{ github.sha }}
path: fluxengine/fluxengine-windows.zip
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: ${{ github.event.repository.name }}.${{ github.sha }}
# path: fluxengine/fluxengine-windows.zip
158 changes: 79 additions & 79 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,85 +10,85 @@ on:
- "master"

jobs:
dev-release:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW32
install: >-
diffutils
make
mingw-w64-i686-binutils
mingw-w64-i686-fmt
mingw-w64-i686-gcc
mingw-w64-i686-libusb
mingw-w64-i686-nsis
mingw-w64-i686-pkg-config
mingw-w64-i686-protobuf
mingw-w64-i686-python
mingw-w64-i686-sqlite3
mingw-w64-i686-wxWidgets
mingw-w64-i686-zlib
mingw-w64-i686-png2ico
vim
zip
- uses: actions/checkout@v3

- name: update-protobuf
run: |
pacman -U --noconfirm https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-protobuf-21.9-1-any.pkg.tar.zst
- name: build
run: |
MAGICK_TIME_LIMIT=100 make -j`nproc`
- name: nsis
run: |
strip fluxengine.exe -o fluxengine-stripped.exe
strip fluxengine-gui.exe -o fluxengine-gui-stripped.exe
makensis -v2 -nocd -dOUTFILE=fluxengine-installer.exe extras/windows-installer.nsi
- name: zip
run: |
zip -9 fluxengine.zip fluxengine.exe fluxengine-gui.exe upgrade-flux-file.exe brother120tool.exe brother240tool.exe FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex
- name: date
run: |
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: tag
uses: EndBug/latest-tag@latest
with:
tag-name: dev
force-branch: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: delete-old-assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: dev
assets: |
fluxengine.zip
fluxengine-installer.exe
fail-if-no-assets: false

- name: release
uses: softprops/action-gh-release@v1
with:
name: Development build ${{ env.RELEASE_DATE }}
files: |
fluxengine.zip
fluxengine-installer.exe
tag_name: dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#dev-release:
# runs-on: windows-latest
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: msys2/setup-msys2@v2
# with:
# update: true
# msystem: MINGW32
# install: >-
# diffutils
# make
# mingw-w64-i686-binutils
# mingw-w64-i686-fmt
# mingw-w64-i686-gcc
# mingw-w64-i686-libusb
# mingw-w64-i686-nsis
# mingw-w64-i686-pkg-config
# mingw-w64-i686-protobuf
# mingw-w64-i686-python
# mingw-w64-i686-sqlite3
# mingw-w64-i686-wxWidgets
# mingw-w64-i686-zlib
# mingw-w64-i686-png2ico
# vim
# zip
# - uses: actions/checkout@v3

# - name: update-protobuf
# run: |
# pacman -U --noconfirm https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-protobuf-21.9-1-any.pkg.tar.zst

# - name: build
# run: |
# MAGICK_TIME_LIMIT=100 make -j`nproc`

# - name: nsis
# run: |
# strip fluxengine.exe -o fluxengine-stripped.exe
# strip fluxengine-gui.exe -o fluxengine-gui-stripped.exe
# makensis -v2 -nocd -dOUTFILE=fluxengine-installer.exe extras/windows-installer.nsi

# - name: zip
# run: |
# zip -9 fluxengine.zip fluxengine.exe fluxengine-gui.exe upgrade-flux-file.exe brother120tool.exe brother240tool.exe FluxEngine.cydsn/CortexM3/ARM_GCC_541/Release/FluxEngine.hex

# - name: date
# run: |
# echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}

# - name: tag
# uses: EndBug/latest-tag@latest
# with:
# tag-name: dev
# force-branch: false
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: delete-old-assets
# uses: mknejp/delete-release-assets@v1
# with:
# token: ${{ github.token }}
# tag: dev
# assets: |
# fluxengine.zip
# fluxengine-installer.exe
# fail-if-no-assets: false

# - name: release
# uses: softprops/action-gh-release@v1
# with:
# name: Development build ${{ env.RELEASE_DATE }}
# files: |
# fluxengine.zip
# fluxengine-installer.exe
# tag_name: dev
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-macos:
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ all: +all README.md
binaries: all
tests: all

README.md: $(OBJ)/scripts+mkdocindex/scripts+mkdocindex$(EXT)
README.md: $(OBJ)/scripts/+mkdocindex/+mkdocindex$(EXT)
@echo MKDOC $@
@csplit -s -f$(OBJ)/README. README.md '/<!-- FORMATSSTART -->/' '%<!-- FORMATSEND -->%'
@(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md
Expand Down
19 changes: 16 additions & 3 deletions build/ab.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@ CXX ?= g++
AR ?= ar
CFLAGS ?= -g -Og
LDFLAGS ?= -g
hide = @
PKG_CONFIG ?= pkg-config
ECHO ?= echo
TARGETS ?= +all

ifdef VERBOSE
hide =
else
ifdef V
hide =
else
hide = @
endif
endif

ifeq ($(OS), Windows_NT)
EXT ?= .exe
Expand All @@ -20,6 +30,9 @@ EXT ?=

include $(OBJ)/build.mk

MAKEFLAGS += -r
.DELETE_ON_ERROR:

.PHONY: update-ab
update-ab:
@echo "Press RETURN to update ab from the repository, or CTRL+C to cancel." \
Expand All @@ -33,10 +46,10 @@ clean::
$(hide) rm -rf $(OBJ) bin

export PYTHONHASHSEED = 1
build-files = $(shell find . -name 'build.py') build/*.py config.py
build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py)
$(OBJ)/build.mk: Makefile $(build-files)
@echo "AB"
@mkdir -p $(OBJ)
$(hide) $(PYTHON) -X pycache_prefix=$(OBJ) build/ab.py -t +all -o $@ \
$(hide) $(PYTHON) -X pycache_prefix=$(OBJ) build/ab.py $(patsubst %,-t %,$(TARGETS)) -o $@ \
build.py || rm -f $@

Loading

0 comments on commit 968b90d

Please sign in to comment.