Skip to content
Merged
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
34 changes: 32 additions & 2 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
publish-android:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
steps:
- uses: actions/checkout@v4
Expand All @@ -31,5 +31,35 @@ jobs:
EOF
echo "local.properties file has been created successfully."
- name: Run publish script
id: publish
working-directory: ./scripts
run: ./publish-android.sh
run: ./publish-android.sh
- name: Create GitHub release

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, not blocking: could the release go in its own job (needs: publish-android) so only that job gets contents: write? The Gradle build would keep a read-only token, and a failed release could be retried with "Re-run failed jobs". Same applies to the other PRs in this batch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we could do that

# Only when this run actually published a new version, and only from a release branch
if: steps.publish.outputs.published == 'true' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next')
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.publish.outputs.version }}
run: |
if gh release view "$VERSION" > /dev/null 2>&1; then
echo "Release $VERSION already exists, skipping."
exit 0
fi

# Release notes: the matching CHANGELOG.md section, falling back to generated notes
awk -v v="$VERSION" '
/^## / { if (found) exit; h=$0; sub(/^## \[?v?/, "", h); sub(/\].*$/, "", h); sub(/ .*$/, "", h); if (h == v) { found=1; next } }
Comment thread
alexgerardojacinto marked this conversation as resolved.
Resolved
found { print }
' CHANGELOG.md > release-notes.md 2>/dev/null || true

args=(--target "$GITHUB_SHA" --title "$VERSION")
if [[ -s release-notes.md ]] && grep -q '[^[:space:]]' release-notes.md; then
args+=(--notes-file release-notes.md)
else
args+=(--generate-notes)
fi
if [[ "$VERSION" == *-* ]]; then
args+=(--prerelease)
fi

gh release create "$VERSION" "${args[@]}"
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

The changes documented here do not include those from the original repository.

# [Unreleased]
## [Unreleased]

# [2.1.2]
## [2.1.2]

### 2026-10-30

- Chore: Update dependencies and build tooling (Gradle 8.14.3, AGP 8.13.0, Kotlin 1.9.25, compileSdk/targetSdk 36, androidx libraries, CameraX 1.4.2, zxing, gson).

# [2.1.1]
## [2.1.1]

### 2026-08-03

- Show camera preview only after permission is granted. This issue was uncovered while updating a consumer app's androidx camera2 dependency do 1.6.2 (https://outsystemsrd.atlassian.net/browse/RMET-5329 + https://github.com/OutSystems/OSBarcodeLib-Android/issues/57)

# [2.1.0]
## [2.1.0]

### 2026-06-26

- Add optional `cancelButtonAccessibilityLabel`, `torchButtonOnAccessibilityLabel` and `torchButtonOffAccessibilityLabel` scan parameters to set the alternative text (content description) read by screen readers on the Cancel and Torch buttons. When not provided, no label is set, keeping the previous behavior unchanged. (https://github.com/OutSystems/OSBarcodeLib-Android/issues/54)

# [2.0.2]
## [2.0.2]

### 2026-06-25

- Prevent Expanded Dark Theme inversion on scanner activity (https://outsystemsrd.atlassian.net/browse/RMET-5280)

# [2.0.1]
## [2.0.1]

### 2025-10-02

Expand Down
6 changes: 6 additions & 0 deletions scripts/publish-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ else

if grep --quiet "BUILD SUCCESSFUL" $LOG_OUTPUT; then
printf %"s\n" "Success: Published to MavenCentral."

# Let the workflow know a new version was published (used to create the GitHub release)
if [[ -n "$GITHUB_OUTPUT" ]]; then
echo "published=true" >> "$GITHUB_OUTPUT"
echo "version=$THE_VERSION" >> "$GITHUB_OUTPUT"
fi
else
printf %"s\n" "Error publishing, check $LOG_OUTPUT for more info! Manually review and release from the Central Portal may be necessary https://central.sonatype.com/publishing/deployments/"
cat $LOG_OUTPUT
Expand Down
Loading