Skip to content

Commit

Permalink
CI: Add workflow to publish releases automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
aperezdc committed Nov 20, 2024
1 parent 05564d9 commit f77698a
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/changelog-last-content.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/^##\s+/ {
if (extracting)
exit;
extracting = 1;
next;
}

{
if (extracting)
print;
}
10 changes: 10 additions & 0 deletions .github/changelog-last-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/env bash
set -eu -o pipefail
version_string=$(awk -e '/^##\s+/ { gsub(/##\s+/, ""); print; exit; }' "$1")
read -r wpe_android_ver wpe_webkit_ver date <<< "${version_string/ - / }"
if [[ -n $wpe_webkit_ver && $wpe_webkit_ver = \(* ]] ; then
wpe_webkit_ver=${wpe_webkit_ver:1:-1}
fi
echo "RELEASE_WPE_ANDROID_VERSION=$wpe_android_ver"
echo "RELEASE_WPE_WEBKIT_VERSION=$wpe_webkit_ver"
echo "RELEASE_DATE=$date"
53 changes: 53 additions & 0 deletions .github/workflows/publish-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish GitHub Release

on:
workflow_dispatch:
inputs:
draftRelease:
description: 'Mark as draft'
required: true
default: true
type: boolean

jobs:
build:
uses: ./.github/workflows/build.yml
with:
build_type: Release
upload:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Prepare Release
id: changelog
run: |
awk -f .github/changelog-last-content.awk CHANGELOG.md > release-notes.md
eval "$(bash .github/changelog-last-version.sh CHANGELOG.md | tee -a "$GITHUB_OUTPUT")"
for item in minibrowser mediaplayer webdriver ; do
mv -vf "$item-Release/release/$item-release.apk" \
"wpe-android-$item-${{ steps.changelog.outputs.RELEASE_WPE_WEBKIT_VERSION }}.apk"
done
- name: Delete Artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
minibrowser-Release
mediaplayer-Release
webdriver-Release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: "WPE Android ${{ steps.changelog.outputs.RELEASE_WPE_WEBKIT_VERSION }} (${{ steps.changelog.outputs.RELEASE_WPE_ANDROID_VERSION }})"
tag_name: "${{ steps.changelog.outputs.RELEASE_WPE_ANDROID_VERSION }}"
draft: ${{ inputs.draftRelease }}
body_path: release-notes.md
files: |
wpe-android-${{ steps.changelog.outputs.RELEASE_WPE_WEBKIT_VERSION }}-minibrowser.apk
wpe-android-${{ steps.changelog.outputs.RELEASE_WPE_WEBKIT_VERSION }}-mediaplayer.apk
wpe-android-${{ steps.changelog.outputs.RELEASE_WPE_WEBKIT_VERSION }}-webdriver.apk
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## v0.1.2
## v0.1.2 (2.46.3) - 2024-11-19

### Changed

Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/check-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _check_file_format(self, file):
return self._check_pascal_case_name(file)
if file_ext in [".conf", ".xml", ".png", ".md", ".webp", ".jpg"]:
return self._check_snake_case_name(file)
if file_ext in [".pro", ".gradle", ".properties", ".jar", ".yml", ".json", ".html", ".js"]:
if file_ext in [".pro", ".gradle", ".properties", ".jar", ".yml", ".json", ".html", ".js", ".awk", ".sh"]:
return self._check_kebab_case_name(file)
if base_name == "CMakeLists.txt":
return self._check_cmake_format(file)
Expand Down

0 comments on commit f77698a

Please sign in to comment.