Skip to content

Commit

Permalink
Merge pull request #213 from arconnectio/chore/adds-semantic-release-…
Browse files Browse the repository at this point in the history
…and-submit

chore: adds semantic-release and cws release
  • Loading branch information
nicholaswma authored Feb 2, 2024
2 parents fd934dd + 9ad8f74 commit bd2c839
Show file tree
Hide file tree
Showing 5 changed files with 2,587 additions and 56 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn build:chrome
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 25 additions & 12 deletions .github/workflows/submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache pnpm modules
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: "20.x"
cache: "yarn"
- name: Cache yarn modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
path: "**/node_modules"
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: 7.1.0
run_install: true
- name: Build and zip extension artifact
run: pnpm build -- --zip
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
- name: Create .env file
run: echo "PLASMO_PUBLIC_ONRAMPER_API_KEY=${{ secrets.ONRAMPER_API_KEY }}" >> .env

- name: Modify package.json and icons for BETA
if: github.ref == 'refs/heads/staging'
run: |
jq '.displayName = "ArConnect BETA"' package.json > temp.json
mv temp.json package.json
cp -rf assets-beta/* assets/
- name: Build and Package the extension into a zip artifact
run: yarn build:chrome --zip
- name: Browser Platform Publish
uses: PlasmoHQ/bpp@v2
uses: PlasmoHQ/bpp@v3
with:
keys: ${{ secrets.SUBMIT_KEYS }}
keys: ${{ github.ref == 'refs/heads/production' && secrets.SUBMIT_KEYS_PRODUCTION || secrets.SUBMIT_KEYS_STAGING }}
artifact: build/chrome-mv3-prod.zip
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
"wouter": "^2.8.0-alpha.2"
},
"devDependencies": {
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@types/chrome": "^0.0.196",
"@types/human-crypto-keys": "^0.1.0",
"@types/react": "^18.0.18",
Expand All @@ -106,6 +108,7 @@
"plasmo": "^0.82.0",
"prettier": "^2.2.1",
"querystring-es3": "^0.2.1",
"semantic-release": "^23.0.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"timers-browserify": "^2.0.12",
Expand Down
24 changes: 24 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const config = {
branches: ["production"],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
npmPublish: false
}
],
[
"@semantic-release/git",
{
assets: ["package.json"],
message:
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
};

module.exports = config;
Loading

0 comments on commit bd2c839

Please sign in to comment.