casdoor 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,3 +26,33 @@ jobs:
26
26
  run: yarn semantic-release
27
27
  env:
28
28
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+ - name: Package
30
+ id: package
31
+ if: github.event_name == 'push' && github.repository == 'casdoor/casdoor-chrome-extension'
32
+ run: |
33
+ tag=$(git tag --points-at HEAD | grep '^v' | head -n 1)
34
+ if [ -z "$tag" ]; then
35
+ echo "No new release, nothing to package"
36
+ exit 0
37
+ fi
38
+ # the version only lives in the tag, it is written into the manifest here and not committed
39
+ node -e 'const fs = require("fs"); const m = JSON.parse(fs.readFileSync("manifest.json")); m.version = process.argv[1]; fs.writeFileSync("manifest.json", JSON.stringify(m, null, 2) + "\n")' "${tag#v}"
40
+ zip -r casdoor-extension.zip manifest.json src images
41
+ gh release upload "$tag" casdoor-extension.zip --clobber
42
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
43
+ env:
44
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
+ - name: Publish to the Chrome Web Store
46
+ if: steps.package.outputs.tag != ''
47
+ run: |
48
+ if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ] || [ -z "$REFRESH_TOKEN" ] || [ -z "$PUBLISHER_ID" ]; then
49
+ echo "::warning::The Chrome Web Store secrets are not set, ${{ steps.package.outputs.tag }} is only attached to the GitHub release"
50
+ exit 0
51
+ fi
52
+ npx --yes chrome-webstore-upload-cli@4.0.2 --source casdoor-extension.zip
53
+ env:
54
+ EXTENSION_ID: bnjbegmkpjbcpneclidlbloadenondlm
55
+ PUBLISHER_ID: ${{ secrets.CHROME_PUBLISHER_ID }}
56
+ CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
57
+ CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
58
+ REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
package/README.md CHANGED
@@ -18,11 +18,14 @@ Casdoor only hands an account out for a page of the system's own sign-in URLs, r
18
18
 
19
19
  ### Install the extension
20
20
 
21
- 1. Go to `chrome://extensions` and check the box for **Developer mode** in the top right.
22
- 2. Click `Load unpacked` button, then choose this project folder.
21
+ Install it from the [Chrome Web Store](https://chromewebstore.google.com/detail/casdoor-browser-plugin/bnjbegmkpjbcpneclidlbloadenondlm). It also works in Edge and other Chromium browsers that allow extensions from the Chrome Web Store.
22
+
23
+ Where the store can't be reached, download `casdoor-extension.zip` from the [latest release](https://github.com/casdoor/casdoor-chrome-extension/releases/latest), unzip it, go to `chrome://extensions`, turn on **Developer mode** in the top right, click **Load unpacked** and choose the unzipped folder.
24
+
25
+ Each release is published to the Chrome Web Store and attached to the GitHub release by `.github/workflows/release.yaml`, with the version of the release written into `manifest.json`. The store can take a few days to review a new version.
23
26
 
24
27
  ### Sign in to Casdoor
25
28
 
26
29
  1. Open the extension, enter the Casdoor URL and the name of the application to sign in with.
27
- 2. Add the address shown at the bottom of the extension (`https://<extension id>.chromiumapp.org/`) to the redirect URLs of that application, and allow the `token` grant type in it.
30
+ 2. Add the address shown at the bottom of the extension (`https://<extension id>.chromiumapp.org/`) to the redirect URLs of that application, and allow the `token` grant type in it. The extension installed from the Chrome Web Store always has the address `https://bnjbegmkpjbcpneclidlbloadenondlm.chromiumapp.org/`, so it can be added once for everyone; an unpacked one gets its own.
28
31
  3. Click **Sign in to Casdoor**. The extension then lists the systems it fills for you.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casdoor",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "The Casdoor extension can help browser users automatically log into applications protected by Casdoor single-sign-on (SSO) system.",
5
5
  "repository": {
6
6
  "type": "git",