Skip to content

Commit 9b64d4d

Browse files
committed
chore: add initial semantic release setup
1 parent e78fe50 commit 9b64d4d

File tree

10 files changed

+317
-13
lines changed

10 files changed

+317
-13
lines changed

.github/workflows/build.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: "build"
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
firefox-zip:
7+
description: "Path to Firefox extension zip file"
8+
value: ${{ jobs.build.outputs.firefox-zip }}
9+
chrome-zip:
10+
description: "Path to Chrome extension zip file"
11+
value: ${{ jobs.build.outputs.chrome-zip }}
12+
safari-zip:
13+
description: "Path to Safari extension zip file"
14+
value: ${{ jobs.build.outputs.safari-zip }}
15+
firefox-sources-zip:
16+
description: "Path to Firefox sources zip file"
17+
value: ${{ jobs.build.outputs.firefox-sources-zip }}
18+
workflow_dispatch:
19+
push:
20+
branches: [main]
21+
pull_request:
22+
branches: [main]
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
outputs:
32+
firefox-zip: ${{ steps.build-info.outputs.firefox-zip }}
33+
chrome-zip: ${{ steps.build-info.outputs.chrome-zip }}
34+
safari-zip: ${{ steps.build-info.outputs.safari-zip }}
35+
firefox-sources-zip: ${{ steps.build-info.outputs.firefox-sources-zip }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version-file: "package.json"
46+
cache: "npm"
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Build extension
52+
run: npm run build
53+
54+
- name: Get build info
55+
id: build-info
56+
run: |
57+
echo "firefox-zip=.output/firefox-mv2-prod.zip" >> $GITHUB_OUTPUT
58+
echo "chrome-zip=.output/chrome-mv3-prod.zip" >> $GITHUB_OUTPUT
59+
echo "safari-zip=.output/safari-mv2-prod.zip" >> $GITHUB_OUTPUT
60+
echo "firefox-sources-zip=.output/firefox-mv2-prod-sources.zip" >> $GITHUB_OUTPUT
61+
62+
- name: Upload Firefox Extension
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: firefox-extension
66+
path: .output/firefox-mv2-prod.zip
67+
retention-days: 30
68+
69+
- name: Upload Chrome Extension
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: chrome-extension
73+
path: .output/chrome-mv3-prod.zip
74+
retention-days: 30
75+
76+
- name: Upload Safari Extension
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: safari-extension
80+
path: .output/safari-mv2-prod.zip
81+
retention-days: 30
82+
83+
- name: Upload Firefox Sources
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: firefox-sources
87+
path: .output/firefox-mv2-prod-sources.zip
88+
retention-days: 30
89+
90+
- name: List build outputs
91+
run: |
92+
echo "Built files:"
93+
ls -la .output/
94+
echo ""
95+
echo "Available artifacts:"
96+
echo "- Firefox Extension: firefox-mv2-prod.zip"
97+
echo "- Chrome Extension: chrome-mv3-prod.zip"
98+
echo "- Safari Extension: safari-mv2-prod.zip"
99+
echo "- Firefox Sources: firefox-mv2-prod-sources.zip"

.github/workflows/lint.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "lint"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request_target:
7+
branches: [main]
8+
types: [opened, synchronize]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: false
13+
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
persist-credentials: false
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version-file: "package.json"
31+
cache: "npm"
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run check
37+
run: npm run lint
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://github.com/googleapis/release-please?tab=readme-ov-file#how-should-i-write-my-commits
2+
name: "semantic / merge"
3+
4+
on:
5+
pull_request_target:
6+
branches: [main]
7+
types: [opened, edited, synchronize, reopened]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
title:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pull-requests: read
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "semantic / release"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: false
10+
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
15+
16+
jobs:
17+
build:
18+
uses: ./.github/workflows/build.yaml
19+
20+
release:
21+
needs: build
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version-file: "package.json"
34+
cache: "npm"
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Download Firefox Extension
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: firefox-extension
43+
path: .output/
44+
45+
- name: Download Chrome Extension
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: chrome-extension
49+
path: .output/
50+
51+
- name: Download Safari Extension
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: safari-extension
55+
path: .output/
56+
57+
- name: Download Firefox Sources
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: firefox-sources
61+
path: .output/
62+
63+
- name: Verify artifacts
64+
run: |
65+
echo "Downloaded artifacts:"
66+
ls -la .output/
67+
68+
- name: Release trigger
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: npx semantic-release

.releaserc.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/npm",
9+
{
10+
"npmPublish": false
11+
}
12+
],
13+
[
14+
"@semantic-release/github",
15+
{
16+
"assets": [
17+
{
18+
"path": ".output/chrome-mv3-prod.zip",
19+
"name": "jsc-unlocker-chrome-${nextRelease.version}.zip",
20+
"label": "Chrome Extension"
21+
},
22+
{
23+
"path": ".output/firefox-mv2-prod.zip",
24+
"name": "jsc-unlocker-firefox-${nextRelease.version}.zip",
25+
"label": "Firefox Extension"
26+
},
27+
{
28+
"path": ".output/safari-mv2-prod.zip",
29+
"name": "jsc-unlocker-safari-${nextRelease.version}.zip",
30+
"label": "Safari Extension"
31+
},
32+
{
33+
"path": ".output/firefox-mv2-prod-sources.zip",
34+
"name": "jsc-unlocker-firefox-sources-${nextRelease.version}.zip",
35+
"label": "Firefox Extension Sources"
36+
}
37+
]
38+
}
39+
],
40+
[
41+
"@semantic-release/git",
42+
{
43+
"assets": ["package.json", "CHANGELOG.md"],
44+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
45+
}
46+
]
47+
]
48+
}

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Contributing 🤝
2+
3+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated versioning and releases. When making commits, please follow this format:
4+
5+
- `feat:` for new features (triggers minor version bump)
6+
- `fix:` for bug fixes (triggers patch version bump)
7+
- `BREAKING CHANGE:` for breaking changes (triggers major version bump)
8+
- `docs:`, `style:`, `refactor:`, `test:`, `chore:` for other changes (no version bump)
9+
10+
Examples:
11+
12+
```text
13+
feat: add support for new login form
14+
fix: resolve virtual keyboard detection issue
15+
docs: update installation instructions
16+
```
17+
18+
Releases are automatically created when changes are pushed to the main branch using semantic-release.

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ Removes the annoying (and arguably useless from a security standpoint) virtual k
77
You can download the latest release for:
88

99
- **Firefox** from [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/jsc-unlocker/)
10-
- **Chrome** from the [Chrome Web Store](https://chromewebstore.google.com/detail/jsc-unlocked/ekeehglopcojnbieeopijckckabkpbfj).
11-
- **Safari**, I won't be paying the 100$/year fee that Apple requires to publish on their store. **See the next section for instructions on how to build the extension yourself from the source code here.** Then lookup how to load a local extension into Safari.
10+
11+
- **Safari**, I won't be paying the 100$ _per year_ fee that Apple requires to publish on their store. **See the next section for instructions on how to build the extension yourself from the source code here.** Then search for how to load a local extension into Safari.
12+
13+
- **Microsoft Edge**, the partner center page to become an extension publisher is currently broken, as is common in these sluggish Microsoft developer dashboards. I have tried opening a support ticket but I get sent to a useless AI system that repeats the same steps and won't let me speak to a human. **See the next section for instructions on how to build the extension yourself from the source code here.** Then search for how to load a local extension into Edge.
14+
1215
- **Opera** from [Opera Add-ons](https://addons.opera.com/en/extensions/details/jsc-unlocker/).
13-
- **Edge** from the [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/jsc-unlocker).
16+
17+
- **Google Chrome** from the [Chrome Web Store](https://chromewebstore.google.com/detail/jsc-unlocked/ekeehglopcojnbieeopijckckabkpbfj).
1418

1519
## Development 🛠️
1620

@@ -28,11 +32,11 @@ _With all requirements ready:_
2832
npm install
2933
```
3034

31-
- Continue to the next step if you want to alter the extension code. If you just want to build it run:
35+
- Continue to the next step if you want to alter the extension code. If you just want to build it, run the respective script:
3236

3337
```shell
3438
npm run build
35-
# The output will be in the `.output` folder!
39+
# The results will be in the `.output` folder!
3640
```
3741

3842
- To see live changes _(hot reload)_ when the extension code is updated, start a development session, which will automatically open a configured browser window. Refer to the `scripts` field in the `package.json` file for more details:
@@ -43,14 +47,14 @@ _With all requirements ready:_
4347
npm run dev:safari
4448
```
4549

46-
- Note that the **Chrome** version of the extension will also work in **Edge** and **Opera**, as these share the same browser engine, **Chromium**. This applies to any other _Chromium-based_ browser as well. Same goes for the **Firefox** version, which will also work in all _Firefox-based_ browsers.
50+
- Note that the **Google Chrome** version of the extension is the same one used for **Edge** and **Opera**, as these share the same browser engine, **Chromium**. This applies to any other _Chromium-based_ browser as well. Same goes for the **Firefox** version, which will also work in all _Firefox-based_ browsers.
4751

48-
#### Tooling 🧰
52+
### Tooling 🧰
4953

50-
- Biome is used as a linter and formatter:
54+
- Biome is used as a linter _and_ formatter:
5155

5256
```shell
53-
npm run check
57+
npm run lint
5458
```
5559

5660
- After running `npm install` pre-commit hooks will be automatically installed to format code before a commit. If for some reason the hooks do not install correctly, instal them manually using:
@@ -59,4 +63,4 @@ _With all requirements ready:_
5963
npx lefthook install
6064
```
6165

62-
- When using pre-commit hooks, git commands will fail if any files are checked with errors. Changed files must be added to the staged area and commited again to apply fixes
66+
- See also the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines if you plan on contributing to the project.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": "1.0.2",
23
"private": true,
34
"engines": {
45
"node": ">=22.0.0"
@@ -8,12 +9,16 @@
89
"dev:firefox": "wxt -b firefox",
910
"dev:chrome": "wxt -b chrome",
1011
"dev:safari": "wxt -b safari",
11-
"build": "wxt zip -b firefox --sources && wxt zip -b chrome && wxt zip -b safari",
12-
"check": "tsc --noEmit && biome check --fix"
12+
"lint": "tsc --noEmit && biome check --fix",
13+
"build": "wxt zip -b firefox --sources && wxt zip -b chrome && wxt zip -b safari"
1314
},
1415
"devDependencies": {
1516
"@biomejs/biome": "2.2.3",
17+
"@semantic-release/changelog": "^6.0.3",
18+
"@semantic-release/git": "^10.0.1",
19+
"@semantic-release/github": "^10.0.3",
1620
"lefthook": "1.12.4",
21+
"semantic-release": "^22.0.12",
1722
"typescript": "5.9.2",
1823
"wxt": "0.20.11"
1924
}

wxt.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { defineConfig } from "wxt";
2+
import { version } from "./package.json";
23

34
const url = "https://www.jogossantacasa.pt/";
45

56
// https://wxt.dev/api/config.html
67
export default defineConfig({
78
manifest: {
89
name: "JSC Unlocker",
9-
version: "1.0.2",
10+
version: version,
1011
description: "Bypasses the forced virtual keyboard in the JSC website.",
1112
permissions: [],
1213
host_permissions: [url],

0 commit comments

Comments
 (0)