ci: initial setup

This commit is contained in:
Derrick Hammer 2023-08-06 20:03:08 -04:00
parent 8bcb0e1ea4
commit 6611372d73
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
5 changed files with 3523 additions and 64 deletions

59
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Build/Publish
on:
push:
branches:
- master
- develop
- develop-*
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.GITEA_SSH_KEY }}
known_hosts: ${{ secrets.GITEA_KNOWN_HOST }}
- name: Download YQ
run: |
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq &&\
chmod +x /usr/bin/yq
- name: Set up S3CMD
uses: s3-actions/s3cmd@v1.5.0
with:
provider: aws # default is linode
region: 'eu-central-1'
access_key: ${{ secrets.S3_ACCESS_KEY }}
secret_key: ${{ secrets.S3_ACCESS_KEY }}
- name: Publish
run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to Firefox
uses: yayuyokitano/firefox-addon@v0.0.6-alpha
with:
api_key: ${{ secrets.AMO_ISSUER }}
api_secret: ${{ secrets.AMO_SECRET }}
guid: 'contact@luneweb.com'
xpi_path: ${{ env.PKG }}
src_path: ${{ env.PKG_SRC }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
with:
limit-access-to-actor: true

80
.releaserc.json Normal file
View File

@ -0,0 +1,80 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "dep",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/exec",
{
"publishCmd": "./publish.sh ${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md",
"npm-shrinkwrap.json",
"assets/manifest.json"
]
}
]
],
"branches": [
"master",
{
"name": "develop",
"prerelease": true
},
{
"name": "develop-*",
"prerelease": true
}
]
}

3426
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,10 @@
{
"name": "@lumeweb/extension",
"version": "0.3.0",
"version": "0.4.0-develop.1",
"description": "Lume Web is your decentralized gateway into the web3 internet, the web owned and controlled by its users",
"main": "index.js",
"type": "module",
"readme": "ERROR: No README data found!",
"_id": "@lumeweb/extension@0.3.0",
"scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
@ -13,6 +12,7 @@
},
"devDependencies": {
"@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.44",
"@semantic-release/exec": "^6.0.3",
"@tsconfig/svelte": "^5.0.0",
"@types/object-diff": "^0.0.2",
"@types/react": "^18.2.17",
@ -26,7 +26,8 @@
"sass": "^1.63.6",
"svelte-check": "^3.4.6",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6"
"typescript": "^5.1.6",
"web-ext": "^7.6.2"
},
"dependencies": {
"@helia/unixfs": "^1.4.0",

15
publish.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
export VERSION="$1"
export PKG="web-ext-artifacts/lume_web-${VERSION}.zip"
export PKG_SRC="web-ext-artifacts/lume_web-${VERSION}-src.zip"
yq -i '.version = strenv(VERSION)' assets/manifest.json
cp assets/manifest.json dist/
web-ext build -s dist
mkdir -p dist-src
cp -r assets shared src ui *.json .js dist-src/
zip -r "web-ext-artifacts/lume_web-${VERSION}-src.zip" dist-src/
echo "EXTENSION_VERSION=${VERSION}" >> $GITHUB_ENV
echo "PKG=${PKG}" >> $GITHUB_ENV
echo "PKG_SRC=${PKG_SRC}" >> $GITHUB_ENV