diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c4d896..741f30b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,20 @@ jobs: steps: - name: Check Out Sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Check Out CRX3-Creator + uses: actions/checkout@v4 + with: + repository: ${{ format( '{0}/CRX3-Creator', github.repository_owner ) }} + ref: 'a5d25b6ccc2007be41bd9cc534dfa51a52692780' + path: 'crx3-creator' + + - name: Install Additional Software + run: | + # required for CRX3-Creator + sudo apt-get install python3-googleapi + sudo apt-get install python3-protobuf - name: Determine Some Strings from Tag run: | @@ -35,26 +48,34 @@ jobs: fi # determine v-prefixed version, simple version, - # extension version, XPI base name and export them + # extension version, XPI base name, CRX base name and + # export them vversion=$tagname sversion=${tagname#v} [[ $tagname =~ ^v(2\.[0-9]+)(\.[0-9]+)?$ ]] xversion=${BASH_REMATCH[1]} xpibname="copy-on-select-2-unsigned-$sversion.xpi" + crxbname="copy-on-select-2-$sversion.crx" echo "vversion=$vversion" >> $GITHUB_ENV echo "sversion=$sversion" >> $GITHUB_ENV echo "xversion=$xversion" >> $GITHUB_ENV echo "xpibname=$xpibname" >> $GITHUB_ENV + echo "crxbname=$crxbname" >> $GITHUB_ENV # ensure the new version is maintained in the extension # manifest - name: Verify Manifest run: | mversion=$( jq -r '.version' src/manifest.json ) - if [[ $xversion != $mversion ]]; then + if [[ $xversion != "$mversion" ]]; then echo "Cannot find version \"$xversion\" in manifest." 1>&2 exit 1 fi + mfversion=$( jq -r '.manifest_version' src/manifest.json ) + if [[ $mfversion != 2 ]]; then + echo "Cannot process manifest version $mfversion." 1>&2 + exit 1 + fi # ensure the new version is described in the version # history and use its description as release description @@ -97,12 +118,23 @@ jobs: mkdir -p build zip -jqr "build/$xpibname" src - - name: Create Release and Upload XPI + - name: Create CRX + env: + CRX_PEM: ${{ secrets.CRX_PEM }} + run: | + mkdir -p build tmp + jq '.manifest_version = 3' src/manifest.json > tmp/manifest.json + mv tmp/manifest.json src/manifest.json + printf '%s\n' "$CRX_PEM" > tmp/crx.pem + python3 crx3-creator/main.py -o "build/$crxbname" \ + -pem tmp/crx.pem src + + - name: Create Release and Upload Packages env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | draft="" - if [[ $sversion != $xversion ]]; then + if [[ $sversion != "$xversion" ]]; then draft="--draft" else draft="" @@ -111,4 +143,5 @@ jobs: gh release create $draft \ --title "Version $sversion" \ --notes-file tmp/reldesc.md \ - "$vversion" "build/$xpibname" + "$vversion" "build/$xpibname" \ + "build/$crxbname" diff --git a/README.md b/README.md index f517f17..7d8f3fa 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,26 @@ is [![Firefox Latest](https://img.shields.io/amo/v/copy-on-select-2)][link-amo] +- Chromium-based browsers (Brave, Ungoogled Chromium) + + Download the latest CRX package from the [release + page](https://github.com/farblos/copy-on-select-2/releases) and + drag-and-drop it onto your browser or open it as a file with + `Ctrl+O`. + +## Known Issues + +Version 2.6 + +- Option "Copy-on-select in input elements" is not effective on + chromium-based browsers. In the sense that on these you cannot + *disable* copy-on-select in input elements. + + The same is true for non-standard input fields on all browsers, + see ["pontoon.mozilla.org" input form problem][issue_12]. + +[issue_12]: https://github.com/farblos/copy-on-select-2/issues/12 +