Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
| `branch` | The default flatpak branch | Optional | `master` |
| `cache` | Enable/Disable caching `.flatpak-builder` directory | Optional | `true` |
| `restore-cache` | Enable/Disable cache restoring. If caching is enabled. | Optional | `true` |
| `save-cache` | Enable/Disable cache uploading. If caching is enabled. | Optional | `true` |
| `cache-key` | Specifies the cache key. CPU arch is automatically added, so there is no need to add it to the cache key. | Optional | `flatpak-builder-${arch}-${sha256(manifestPath)}` |
| `arch` | Specifies the CPU architecture to build for | Optional | `x86_64` |
| `mirror-screenshots-url` | Specifies the URL to mirror screenshots | Optional | - |
Expand Down
6 changes: 6 additions & 0 deletions flatpak-builder/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ inputs:
Possible values: true, enabled, yes, y. Or something else to disable it.
default: "true"
required: false
save-cache:
description: >
Toggles saving the cache.
Possible values: true, enabled, yes, y. Or something else to disable it.
default: "true"
required: false
cache-key:
description: >
Defines the cache-key to use.
Expand Down
4 changes: 3 additions & 1 deletion flatpak-builder/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class Configuration {
this.debugBundle = this.bundle.replace('.flatpak', '') + '-debug.flatpak'
// Whether to restore the cache or not
this.restoreCache = core.getBooleanInput('restore-cache')
// Whether to save the cache or not
this.saveCache = core.getBooleanInput('save-cache')
// Whether to enable caching the build directory
this.cacheBuildDir = core.getBooleanInput('cache')
// The repository used to install the runtime from
Expand Down Expand Up @@ -269,7 +271,7 @@ const build = async (manifest, manifestPath, cacheHitKey, config) => {

await exec.exec('xvfb-run --auto-servernum flatpak-builder', args)

if (config.cacheBuildDir && (cacheKey !== cacheHitKey)) {
if (config.cacheBuildDir && config.saveCache && (cacheKey !== cacheHitKey)) {
await cache.saveCache(
CACHE_PATH,
cacheKey
Expand Down
4 changes: 3 additions & 1 deletion flatpak-builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Configuration {
this.debugBundle = this.bundle.replace('.flatpak', '') + '-debug.flatpak'
// Whether to restore the cache or not
this.restoreCache = core.getBooleanInput('restore-cache')
// Whether to save the cache or not
this.saveCache = core.getBooleanInput('save-cache')
// Whether to enable caching the build directory
this.cacheBuildDir = core.getBooleanInput('cache')
// The repository used to install the runtime from
Expand Down Expand Up @@ -263,7 +265,7 @@ const build = async (manifest, manifestPath, cacheHitKey, config) => {

await exec.exec('xvfb-run --auto-servernum flatpak-builder', args)

if (config.cacheBuildDir && (cacheKey !== cacheHitKey)) {
if (config.cacheBuildDir && config.saveCache && (cacheKey !== cacheHitKey)) {
await cache.saveCache(
CACHE_PATH,
cacheKey
Expand Down