Skip to content

Commit

Permalink
ci: release extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alsakhaev committed Jul 8, 2024
1 parent dc5daef commit a42d5c0
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 107 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/extension-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CD
on:
workflow_dispatch:
push:
branches:
- master
- develop
paths-ignore:
- 'package.json'
- 'package-lock.json'
- 'CHANGELOG.md'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.15.5
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build, bump and release the extension to GitHub Releases
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: pnpm release
38 changes: 38 additions & 0 deletions apps/extension/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"branches": [
"master",
{
"name": "develop",
"prerelease": "alpha"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"package.json"
]
}
],
[
"@semantic-release/exec",
{
"publishCmd": "pnpm run build:extension && cd build && zip -r mutable-web-extension.zip *"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/mutable-web-extension.zip",
"label": "Browser Extension (zip)"
}
]
}
]
]
}
57 changes: 5 additions & 52 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"prettify": "prettier --write src",
"eslint": "eslint ./src --ext .ts --fix",
"stylelint": "stylelint ./src/**/*.{css,scss,module.scss} --fix",
"test": "playwright test"
"test": "playwright test",
"release": "semantic-release"
},
"devDependencies": {
"@playwright/test": "^1.42.1",
Expand Down Expand Up @@ -87,66 +88,18 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dapplets/mutable-web-extension.git"
"url": "git+https://github.com/dapplets/mutable-web-monorepo.git"
},
"author": "Dapplets Team <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/dapplets/mutable-web-extension/issues"
"url": "https://github.com/dapplets/mutable-web-monorepo/issues"
},
"homepage": "https://github.com/dapplets/mutable-web-extension#readme",
"homepage": "https://github.com/dapplets/mutable-web-monorepo#readme",
"files": [
"lib/**/*"
],
"publishConfig": {
"access": "public"
},
"release": {
"branches": [
"master",
{
"name": "testing",
"prerelease": "beta"
},
{
"name": "develop",
"prerelease": "alpha"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json"
]
}
],
[
"@semantic-release/exec",
{
"publishCmd": "npm run build:extension && cd build && zip -r dapplet-extension.zip *"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/dapplet-extension.zip",
"label": "Browser Extension (zip)"
},
{
"path": "lib/index.min.js",
"label": "Pure JSLib for browser (js)"
}
]
}
]
]
}
}
57 changes: 8 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,65 +16,24 @@
"dev": "turbo run dev",
"clean": "turbo run clean",
"autoclave": "rimraf libs/**/dist && rimraf libs/**/lib && rimraf libs/**/node_modules && rimraf libs/**/coverage && rimraf libs/**/.turbo && rimraf apps/**/dist && rimraf apps/**/lib && rimraf apps/**/node_modules && rimraf apps/**/coverage && rimraf apps/**/build && rimraf apps/**/.turbo && rm -rf node_modules",
"test": "turbo run test"
"test": "turbo run test",
"release": "turbo run release --filter=@mweb/extension"
},
"devDependencies": {
"@babel/preset-env": "^7.24.4",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "5.31.0",
"@typescript-eslint/parser": "5.31.0",
"babel-jest": "^29.7.0",
"eslint": "8.20.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "3.2.5",
"rimraf": "3.0.2",
"semantic-release": "^19.0.5",
"ts-jest": "^29.1.2",
"turbo": "^2.0.6",
"typescript": "^5.3.3",
"@typescript-eslint/eslint-plugin": "5.31.0",
"@typescript-eslint/parser": "5.31.0",
"eslint": "8.20.0",
"rimraf": "3.0.2"
},
"release": {
"branches": [
"master",
{
"name": "develop",
"prerelease": "alpha"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"pnpm-lock.yaml"
]
}
],
[
"@semantic-release/exec",
{
"publishCmd": "pnpm run build:extension:testnet && cd build && zip -r mweb-extension-testnet.zip *"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/dapplet-extension.zip",
"label": "Browser Extension (zip)"
},
{
"path": "lib/index.min.js",
"label": "Pure JSLib for browser (js)"
}
]
}
]
]
"typescript": "^5.3.3"
}
}
15 changes: 9 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"dev": {
"persistent": true,
"cache": false
},
"release": {
"cache": false
}
}
}

0 comments on commit a42d5c0

Please sign in to comment.