Skip to content

Commit 4c6d6e1

Browse files
authored
Merge pull request #130 from what3words/fix/snapshot-release-job-does-not-run
Add manual trigger to snapshot workflow
2 parents 1021c70 + c7f4165 commit 4c6d6e1

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

.github/workflows/BuildTestSnapshot.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,20 @@ on:
99
- 'epic/**'
1010
pull_request:
1111
branches:
12-
- 'epic/**'
12+
- 'staging'
1313
types: [ closed ]
14+
workflow_dispatch:
15+
inputs:
16+
force_snapshot_lib:
17+
description: 'Force snapshot-lib to run'
18+
required: false
19+
type: boolean
20+
default: false
21+
force_snapshot_compose_lib:
22+
description: 'Force snapshot-compose-lib to run'
23+
required: false
24+
type: boolean
25+
default: false
1426

1527
jobs:
1628
detect-changes:
@@ -108,13 +120,14 @@ jobs:
108120
# This job must explicitly depend on build_test and detect-changes
109121
needs: [build_test, detect-changes]
110122
# Run for direct commits to epic branches OR when PRs are merged into epic branches
111-
# AND only when build_test succeeds AND lib has changed
123+
# AND only when build_test succeeds AND lib has changed OR manually triggered with force_snapshot_lib
112124
if: >
113125
success() &&
114-
needs.detect-changes.outputs.lib-changed == 'true' &&
115-
((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/epic/')) ||
116-
(github.event_name == 'pull_request' && github.event.action == 'closed' &&
117-
github.event.pull_request.merged == true && startsWith(github.base_ref, 'staging')))
126+
((github.event_name == 'workflow_dispatch' && github.event.inputs.force_snapshot_lib == 'true') ||
127+
(needs.detect-changes.outputs.lib-changed == 'true' &&
128+
((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/epic/')) ||
129+
(github.event_name == 'pull_request' && github.event.action == 'closed' &&
130+
github.event.pull_request.merged == true && startsWith(github.base_ref, 'staging')))))
118131
runs-on: ubuntu-latest
119132
steps:
120133
- name: Checkout code
@@ -155,13 +168,14 @@ jobs:
155168
# This job must explicitly depend on build_test and detect-changes
156169
needs: [build_test, detect-changes]
157170
# Run for direct commits to epic branches OR when PRs are merged into epic branches
158-
# AND only when build_test succeeds AND lib-compose has changed
171+
# AND only when build_test succeeds AND lib-compose has changed OR manually triggered with force_snapshot_compose_lib
159172
if: >
160173
success() &&
161-
needs.detect-changes.outputs.lib-compose-changed == 'true' &&
162-
((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/epic/')) ||
163-
(github.event_name == 'pull_request' && github.event.action == 'closed' &&
164-
github.event.pull_request.merged == true && startsWith(github.base_ref, 'staging')))
174+
((github.event_name == 'workflow_dispatch' && github.event.inputs.force_snapshot_compose_lib == 'true') ||
175+
(needs.detect-changes.outputs.lib-compose-changed == 'true' &&
176+
((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/epic/')) ||
177+
(github.event_name == 'pull_request' && github.event.action == 'closed' &&
178+
github.event.pull_request.merged == true && startsWith(github.base_ref, 'staging')))))
165179
runs-on: ubuntu-latest
166180
steps:
167181
- name: Checkout code

lib-compose/src/main/java/com/what3words/components/compose/maps/utils/BitmapUtils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.ui.graphics.toArgb
1111
import androidx.core.graphics.PathParser
1212
import com.what3words.components.compose.maps.models.W3WMarkerColor
1313
import com.what3words.map.components.compose.R
14+
import androidx.core.graphics.createBitmap
1415

1516
/**
1617
* Creates a bitmap for the standard what3words marker.
@@ -187,7 +188,7 @@ fun getBitMapFromPathData(
187188

188189
// Create a Bitmap of the target size
189190
val bitmap = try {
190-
Bitmap.createBitmap(widthScaled + paddingPx * 2, heightScaled + paddingPx * 2, Bitmap.Config.ARGB_8888)
191+
createBitmap(widthScaled + paddingPx * 2, heightScaled + paddingPx * 2)
191192
} catch (e: OutOfMemoryError) {
192193
throw IllegalArgumentException("Bitmap too large to allocate", e)
193194
}

0 commit comments

Comments
 (0)