Skip to content

Commit

Permalink
Add CI and fix lint. +semver:set:1.0.0+0
Browse files Browse the repository at this point in the history
  • Loading branch information
willson556 committed Jan 15, 2024
1 parent bf97ec0 commit b0de741
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 163 deletions.
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"react/react-in-jsx-scope": "off"
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-explicit-any": "off"
},
"globals": {
"chrome": "readonly"
},
"ignorePatterns": ["watch.js", "dist/**"]
"ignorePatterns": ["watch.js", "dist/**"],
"settings": {
"react": {
"version": "detect"
}
}
}
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build

on:
workflow_call:
inputs:
version_full:
required: true
type: string
version_major:
required: true
type: string
version_minor:
required: true
type: string
version_patch:
required: true
type: string
version_build:
required: true
type: string
current_branch:
required: true
type: string

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
browser: chrome
- os: ubuntu-latest
browser: firefox
- os: ubuntu-latest
browser: edge
- os: macos-latest
browser: safari

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '21'

- name: Set Version
run: npm version --no-git-tag-version --allow-same-version ${{ inputs.version_full }}

- name: Install dependencies
run: npm install

- name: Build
run: npm run build ${{ matrix.browser }}

- name: Generate Safari Project
if: matrix.browser == 'safari'
run: npm run build-safari

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: extension-${{ matrix.browser }}
path: dist/${{ matrix.browser }}

- name: Upload Safari Project
if: matrix.browser == 'safari'
uses: actions/upload-artifact@v4
with:
name: extension-safari-project
path: xcode/

24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '21'

- name: Install dependencies
run: npm install

- name: Lint
run: npx eslint src


39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: main

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
cancel-in-progress: true

jobs:
determine-version:
uses: StaflSystems/CustomGitHubActions/.github/workflows/determine-version.yml@main
secrets: inherit

lint:
uses: ./.github/workflows/lint.yml
secrets: inherit

build:
uses: ./.github/workflows/build.yml
secrets: inherit
needs: [ determine-version ]
with:
version_full: ${{ needs.determine-version.outputs.version_full }}
version_major: ${{ needs.determine-version.outputs.version_major }}
version_minor: ${{ needs.determine-version.outputs.version_minor }}
version_patch: ${{ needs.determine-version.outputs.version_patch }}
version_build: ${{ needs.determine-version.outputs.version_build }}
current_branch: ${{ needs.determine-version.outputs.current_branch }}

tag:
uses: ./.github/workflows/tag.yml
secrets: inherit
needs: [ determine-version, build, lint ]
with:
version_full: ${{ needs.determine-version.outputs.version_full }}
27 changes: 27 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: tag

on:
workflow_call:
inputs:
version_full:
required: true
type: string

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Download Release Artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
pattern: extension-*
merge-multiple: true

- name: Create a GitHub release
if: github.ref == 'refs/heads/main'
uses: StaflSystems/release-action@main
with:
artifacts: "release-artifacts/*"
tag: ${{ inputs.version_full }}
commit: ${{ github.sha }}
Loading

0 comments on commit b0de741

Please sign in to comment.