-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into release
- Loading branch information
Showing
4 changed files
with
62 additions
and
33 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
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 |
---|---|---|
|
@@ -29,21 +29,21 @@ jobs: | |
name: 'ufbt: Build for Dev branch' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Build with ufbt | ||
uses: flipperdevices/[email protected].0 | ||
uses: flipperdevices/[email protected] | ||
id: build-app | ||
with: | ||
# Set to 'release' to build for latest published release version | ||
sdk-channel: dev | ||
- name: Upload app artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: fap-${{ steps.build-app.outputs.suffix }} | ||
name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }} | ||
path: ${{ steps.build-app.outputs.fap-artifacts }} | ||
# You can remove this step if you don't want to check source code formatting | ||
- name: Lint sources | ||
uses: flipperdevices/[email protected].0 | ||
uses: flipperdevices/[email protected] | ||
with: | ||
# skip SDK setup, we already did it in previous step | ||
skip-setup: true | ||
|
@@ -52,11 +52,19 @@ jobs: | |
### Advanced example: build for multiple SDK sources | ||
This example will build your application for 3 different SDK sources: `dev` and `release` channels of official firmware, and for an SDK from an unofficial source. It will upload generated binaries to GitHub artifacts. | ||
This example will build your application for 3 different SDK sources: `dev` and `release` channels of official firmware, and for an SDK from an unofficial source. It will upload generated binaries to GitHub artifacts. It will also do a build every day, even if there are no new commits in the repository, so you can be sure that your application is always up to date with the latest SDK. | ||
|
||
```yaml | ||
name: "FAP: Build for multiple SDK sources" | ||
on: [push, pull_request] | ||
on: | ||
push: | ||
## put your main branch name under "braches" | ||
#branches: | ||
# - master | ||
pull_request: | ||
schedule: | ||
# do a build every day | ||
- cron: "1 1 * * *" | ||
jobs: | ||
ufbt-build-action: | ||
runs-on: ubuntu-latest | ||
|
@@ -70,51 +78,53 @@ jobs: | |
- name: Unofficial firmware | ||
# example URL, replace with a valid one | ||
# you can also use other modes for specifying SDK sources | ||
sdk-index-url: https://up.unofficialflip.com/directory.json | ||
sdk-index-url: https://flipper.example.com/directory.json | ||
sdk-channel: dev | ||
name: 'ufbt: Build for ${{ matrix.name }}' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Build with ufbt | ||
uses: flipperdevices/[email protected].0 | ||
uses: flipperdevices/[email protected] | ||
id: build-app | ||
with: | ||
sdk-channel: ${{ matrix.sdk-channel }} | ||
sdk-index-url: ${{ matrix.sdk-index-url }} | ||
- name: Upload app artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: fap-${{ steps.build-app.outputs.suffix }} | ||
name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }} | ||
path: ${{ steps.build-app.outputs.fap-artifacts }} | ||
``` | ||
|
||
## Inputs | ||
|
||
All inputs are **optional**. If you don't specify any inputs, `ufbt` will build your application for the latest release version of official firmware. You can use [fap-artifacts](#fap-artifacts) output to get a list of built files to [upload them](https://github.com/marketplace/actions/upload-a-build-artifact). | ||
|
||
#### `task` | ||
|
||
**Optional** Task to run. Can be `setup`, `build` or `lint`. Default is `"build"`. | ||
Task to run. Can be `setup`, `build` or `lint`. Default is `"build"`. | ||
|
||
#### `app-dir` | ||
|
||
**Optional** Path to application's source code. Default is `"."` - the root of the repository. | ||
Path to application's source code. Default is `"."` — the root of the repository. | ||
|
||
#### `ufbt-version` | ||
|
||
**Optional** Version of `ufbt` to use. Default is `"latest"` - the latest version available on PyPI. If set to `prerelease`, this action will fetch the latest [pre-release version](https://pypi.org/project/ufbt/#history). You can also use a PyPI version specifier, such as `">=0.2.1,<0.3.0"`. | ||
Version of `ufbt` to use. Default is `"latest"` — the latest version available on PyPI. If set to `prerelease`, this action will fetch the latest [pre-release version](https://pypi.org/project/ufbt/#history). You can also use a PyPI version specifier, such as `">=0.2.1,<0.3.0"`. | ||
|
||
#### `ufbt-args` | ||
|
||
**Optional** Additional arguments to pass to `ufbt`. Default is `-s` - which suppresses build system output, only leaving subcommands' outputs, such as compiler messages. Set to `""` for extra verbosity. | ||
Additional arguments to pass to `ufbt`. Default is `-s` — which suppresses build system output, only leaving subcommands' outputs, such as compiler messages. Set to `""` for extra verbosity. | ||
Only handled when `task` is set to `build` or `lint`. See `ufbt` documentation for details. | ||
|
||
#### `skip-setup` | ||
|
||
**Optional** If set to `true`, skips SDK setup. Useful when running multiple action multiple times. Default is `false`. | ||
If set to `true`, skips SDK setup. Useful when running multiple action multiple times. Default is `false`. | ||
|
||
#### SDK source options | ||
|
||
Table below describes options for SDK update. See ufbt documentation on available [SDK update modes](https://github.com/flipperdevices/flipperzero-ufbt/blob/dev/README.md#managing-the-sdk) for details. All these inputs are **optional**. | ||
Table below describes options for SDK update. See ufbt documentation on available [SDK update modes](https://github.com/flipperdevices/flipperzero-ufbt/blob/dev/README.md#managing-the-sdk) for details. | ||
|
||
| Input name | `ufbt update` argument | Description | | ||
| --- | --- | --- | | ||
|
@@ -147,6 +157,10 @@ A suffix to use in artifact names, includes hardware target, API and SDK version | |
|
||
A list of linter messages, in case of any formatting errors. Only available in `lint` mode. | ||
|
||
#### `build-errors` | ||
|
||
A list of build errors, in case of any. Only available in `build` mode. | ||
|
||
#### `ufbt-status` | ||
|
||
A string, JSON object with ufbt status. Contains `ufbt status --json` output. Useful for extracting information about ufbt's directories, configured modes, etc. Useful in combination with [fromJSON() function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) to extract information from the output. For example, `${{ fromJSON(steps.<build>.ufbt-status).toolchain_dir }}`. Available in all modes. | ||
|
@@ -157,4 +171,4 @@ A version of the toolchain used to build the application. Defined by current SDK | |
|
||
## Acknowledgements | ||
|
||
First version of this action was created by [Oleksii Kutuzov](https://github.com/oleksiikutuzov) and is available [here](https://github.com/oleksiikutuzov/flipperzero-ufbt-action). However, it no longer works with the latest version of `ufbt`. This version is a complete rewrite, with problem matcher borrowed from original verison. | ||
First version of this action was created by [Oleksii Kutuzov](https://github.com/oleksiikutuzov) and is available [here](https://github.com/oleksiikutuzov/flipperzero-ufbt-action). However, it no longer works with the latest version of `ufbt`. This version is a complete rewrite, with problem matcher borrowed from original verison. |
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