Skip to content

Commit

Permalink
build(patch): supports submitting to firefox store
Browse files Browse the repository at this point in the history
  • Loading branch information
ajyey committed Jun 24, 2024
1 parent 22a9d2f commit 4dd8868
Show file tree
Hide file tree
Showing 4 changed files with 3,237 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ jobs:
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
GITHUB_REF: ${{ github.ref }}
FIREFOX_API_KEY: ${{ secrets.FIREFOX_API_KEY }}
FIREFOX_SECRET_KEY: ${{ secrets.FIREFOX_SECRET_KEY }}
run: npx semantic-release
28 changes: 24 additions & 4 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// .releaserc.js
const currentBranch =
process.env.GITHUB_REF && process.env.GITHUB_REF.replace('refs/heads/', '');

Expand All @@ -9,11 +8,17 @@ const generatePluginsConfig = () => {
{
preset: 'angular',
releaseRules: [
{ scope: 'no-release', release: false },
{ type: 'build', scope: 'major', release: 'major' },
{ type: 'build', scope: 'minor', release: 'minor' },
{ type: 'build', scope: 'patch', release: 'patch' },
{ type: 'chore', scope: 'deps', release: 'patch' },
{ type: 'feat', scope: 'major', release: 'major' },
{ type: 'refactor', release: 'patch' },
{ type: 'refactor', scope: 'types', release: 'minor' },
{ type: 'feat', scope: 'major', release: 'major' },
{ scope: 'no-release', release: false }
{ type: 'release', scope: 'major', release: 'major' },
{ type: 'release', scope: 'minor', release: 'minor' },
{ type: 'release', scope: 'patch', release: 'patch' }
]
}
],
Expand Down Expand Up @@ -44,6 +49,16 @@ const generatePluginsConfig = () => {
target: currentBranch === 'main' ? 'default' : 'local' // only publish to chrome store on main branch
}
],
[
'semantic-release-firefox-add-on',
{
extensionId: '{c48d361c-1173-11ee-be56-0242ac120002}',
targetXpi: 'masked-email-manager_v${nextRelease.version}_firefox.xpi',
sourceDir: 'dist-firefox',
channel: currentBranch === 'main' ? 'listed' : 'unlisted', // only publish to firefox store on main branch
artifactsDir: 'artifacts'
}
],
[
'@semantic-release/github',
{
Expand All @@ -52,6 +67,11 @@ const generatePluginsConfig = () => {
path: 'masked-email-manager_*_chrome.zip',
name: 'masked-email-manager_v${nextRelease.version}_chrome.zip',
label: 'Chrome Extension v${nextRelease.version}'
},
{
path: 'artifacts/masked-email-manager_v${nextRelease.version}_firefox.xpi',
name: 'masked-email-manager_v${nextRelease.version}_firefox.xpi',
label: 'Firefox Add-on v${nextRelease.version}'
}
]
}
Expand All @@ -77,4 +97,4 @@ export default {
},
],
plugins: generatePluginsConfig(),
};
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"run-script-os": "^1.1.6",
"semantic-release": "^24.0.0",
"semantic-release-chrome": "^3.2.0",
"semantic-release-firefox-add-on": "^0.2.8",
"tailwindcss": "^3.4.4",
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
Expand Down
Loading

0 comments on commit 4dd8868

Please sign in to comment.