-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add app reload hook * Fix tests with bash 5.2.21 * Add patch_rm2fb * Add install-lib hook * Add python 3.12 * Change standalone to pyinstaller so that hooks can still work * Add pip package build * Add pypi upload * Add unit tests for strip hook * Do a quick sanity check of built executables * Update release with artifacts
- Loading branch information
Showing
20 changed files
with
796 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
name: Check and Build | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
permissions: read-all | ||
jobs: | ||
format: | ||
name: Check formatting | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.11', '3.12'] | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: 'pip' | ||
- name: Check formatting | ||
run: make format | ||
lint: | ||
name: Check for erroneous constructs | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.11', '3.12'] | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: 'pip' | ||
- name: Check for erroneous constructs | ||
run: make lint | ||
links: | ||
name: Check Markdown links | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- name: Check Markdown links | ||
run: | | ||
npm install -g markdown-link-check | ||
make links | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.11', '3.12'] | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: 'pip' | ||
- name: Run tests | ||
run: make test | ||
build: | ||
name: Make pip packages | ||
runs-on: ubuntu-20.04 | ||
needs: [format, lint, test] | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Building toltecmk | ||
run: make build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: pip | ||
path: dist/* | ||
if-no-files-found: error | ||
standalone: | ||
name: Make Standalone | ||
runs-on: ubuntu-20.04 | ||
needs: [format, lint, test] | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Building toltecmk | ||
run: make standalone | ||
- name: Sanity check | ||
run: ./toltecmk --help | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: toltecmk | ||
path: toltecmk | ||
if-no-files-found: error | ||
publish: | ||
name: Publish to PyPi | ||
runs-on: ubuntu-20.04 | ||
needs: [build, links] | ||
if: github.repository == 'toltec-dev/build' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
permissions: | ||
id-token: write | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/toltecmk | ||
steps: | ||
- name: Download pip packages | ||
id: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: pip | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: ${{ steps.download.outputs.download-path }} | ||
release: | ||
name: Add ${{ matrix.artifact }} to release | ||
if: github.repository == 'toltec-dev/build' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
needs: [standalone, build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
artifact: | ||
- 'pip' | ||
- 'toltecmk' | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v4 | ||
- name: Download executable | ||
id: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ matrix.artifact }} | ||
path: dist | ||
- name: Upload to release | ||
run: | ||
find . -type f | xargs -rI {} gh release upload "$TAG" {} --clobber | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
TAG: ${{ github.event.release.tag_name }} | ||
working-directory: ${{ steps.download.outputs.download-path }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "toltecmk" | ||
version = "0.2.1" | ||
version = "0.3.0" | ||
authors = [ | ||
{ name="Mattéo Delabre", email="[email protected]" }, | ||
{ name="Eeems", email="[email protected]" }, | ||
|
@@ -40,9 +40,9 @@ packages = [ | |
] | ||
|
||
[tool.setuptools.package-data] | ||
toltec = ["*.py.typed"] | ||
"toltec.recipe_parsers" = ["*.py.typed"] | ||
"toltec.hooks" = ["*.py.typed"] | ||
toltec = ["py.typed", "*.py.typed"] | ||
"toltec.recipe_parsers" = ["py.typed", "*.py.typed"] | ||
"toltec.hooks" = ["py.typed", "*.py.typed"] | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
docker==6.1.3 | ||
python-dateutil==2.8.2 | ||
pyelftools==0.29 | ||
pyelftools==0.30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2023 The Toltec Contributors | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include <stdio.h> | ||
|
||
int main() { | ||
printf("Hello, World!"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2023 The Toltec Contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
pkgnames=(hello) | ||
pkgdesc="Hello World!" | ||
timestamp=2023-12-27T00:58Z | ||
maintainer="Eeems <[email protected]>" | ||
url="https://github.com/toltec-dev/build" | ||
license=MIT | ||
pkgver=0.0.1-1 | ||
section="utils" | ||
flags=() | ||
|
||
image=base:v2.1 | ||
source=(hello.c) | ||
sha256sums=(SKIP) | ||
|
||
build() { | ||
export CC="${CROSS_COMPILE}gcc" | ||
"$CC" -o hello hello.c | ||
} | ||
package() { | ||
install -D -m 755 "$srcdir"/hello "$pkgdir"/opt/bin/hello | ||
} |
Oops, something went wrong.