Skip to content

add keep-build-dirs flag #229

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

Open
wants to merge 2 commits 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
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ If you plan to contribute to flatpak-github-actions, here's a couple of things t

For more details, we recommend looking the extensive guide at [Creating a JavaScript action](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#prerequisites)

Once you have modified the `index.js` of either `flatpak-builder` or `flat-manager` action. Make sure to compile the file to the `dist` directory. You can do so with
Once you have modified the `index.js` of either `flatpak-builder` or `flat-manager` action, make sure to compile the file to the `dist` directory.
Note: You should have already installed the npm packages of both `flatpak-builder` and `flat-manager`, with yarn.

```shell
ncc build ./flatpak-builder/index.js -o ./flatpak-builder/dist/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
| `arch` | Specifies the CPU architecture to build for | Optional | `x86_64` |
| `mirror-screenshots-url` | Specifies the URL to mirror screenshots | Optional | - |
| `gpg-sign` | The key to sign the package | Optional | - |
| `keep-build-dirs` | Keep build directories after the build finishes (passes `--keep-build-dirs` to flatpak-builder). Useful for debugging intermediate files. | Optional | `false` |
| `verbose` | Enable verbosity | Optional | `false` |
| `upload-artifact` | Whether to upload the resulting bundle or not as an artifact | Optional | `true` |

Expand Down
7 changes: 7 additions & 0 deletions flatpak-builder/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ inputs:
Defines the cache-key to use.
Defaults to flatpak-builder-${arch}-${sha256(manifestPath)}
required: false
keep-build-dirs:
description: >
Keep build directories after the build finishes, passing `--keep-build-dirs` flag
to flatpak-builder.
Possible values: true, enabled, yes, y. Defaults to false.
required: false
default: "false"
branch:
description: The flatpak branch.
default: "master"
Expand Down
5 changes: 5 additions & 0 deletions flatpak-builder/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class Configuration {
this.mirrorScreenshotsUrl = core.getInput('mirror-screenshots-url')
// The key to sign the package
this.gpgSign = core.getInput('gpg-sign')
// Keep build directories after the build (pass --keep-build-dirs)
this.keepBuildDirs = core.getBooleanInput('keep-build-dirs')
// Modified manifest path
this.modifiedManifestPath = path.join(
path.dirname(this.manifestPath),
Expand Down Expand Up @@ -232,6 +234,9 @@ const build = async (manifest, manifestPath, cacheHitKey, config) => {
`--default-branch=${branch}`,
`--arch=${config.arch}`
]
if (config.keepBuildDirs) {
args.push('--keep-build-dirs')
}
if (config.cacheBuildDir) {
args.push('--ccache')
}
Expand Down
5 changes: 5 additions & 0 deletions flatpak-builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Configuration {
this.mirrorScreenshotsUrl = core.getInput('mirror-screenshots-url')
// The key to sign the package
this.gpgSign = core.getInput('gpg-sign')
// Keep build directories after the build (pass --keep-build-dirs)
this.keepBuildDirs = core.getBooleanInput('keep-build-dirs')
// Modified manifest path
this.modifiedManifestPath = path.join(
path.dirname(this.manifestPath),
Expand Down Expand Up @@ -226,6 +228,9 @@ const build = async (manifest, manifestPath, cacheHitKey, config) => {
`--default-branch=${branch}`,
`--arch=${config.arch}`
]
if (config.keepBuildDirs) {
args.push('--keep-build-dirs')
}
if (config.cacheBuildDir) {
args.push('--ccache')
}
Expand Down