Skip to content

Commit

Permalink
Merge branch 'johannesjo:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaphireLiu authored Aug 26, 2024
2 parents 334c1e7 + 7aa8fb9 commit cd23263
Show file tree
Hide file tree
Showing 641 changed files with 37,678 additions and 49,190 deletions.
18 changes: 13 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"root": true,
"ignorePatterns": ["app-builds/**/*", "dist/**", "node_modules/**/*"],
"ignorePatterns": [
"app-builds/**/*",
"dist/**",
"node_modules/**/*",
"src/app/t.const.ts"
],
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"excludedFiles": [],
"parserOptions": {
"project": ["tsconfig.json", "e2e/tsconfig.e2e.json"],
"ecmaVersion": 2020,
"sourceType": "module",
"createDefaultProgram": true
Expand All @@ -16,7 +21,7 @@
"plugin:@angular-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "prettier", "unused-imports", "prefer-arrow"],
"plugins": ["@typescript-eslint", "prettier", "prefer-arrow"],
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/ban-ts-comment": 0,
Expand All @@ -30,7 +35,6 @@
"args": "none"
}
],
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
Expand Down Expand Up @@ -60,7 +64,11 @@
"selector": "default",
"format": ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
"leadingUnderscore": "allowSingleOrDouble",
"trailingUnderscore": "allow"
"trailingUnderscore": "allow",
"filter": {
"regex": "(should)|@tags",
"match": false
}
},
{
"selector": "variable",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-create-windows-store-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue
run: npm install @nx/nx-win32-x64-msvc

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-to-aur-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
ssh_keyscan_types: rsa,ecdsa,ed25519
5 changes: 4 additions & 1 deletion .github/workflows/build-publish-to-mac-store-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue and dmg licence issue
run: npm install @nx/nx-darwin-arm64 dmg-license

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand All @@ -58,7 +61,7 @@ jobs:
- name: Build Frontend & Electron
run: npm run build

- uses: apple-actions/import-codesign-certs@v2
- uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.mac_certs }}
p12-password: ${{ secrets.mac_certs_password }}
Expand Down
119 changes: 63 additions & 56 deletions .github/workflows/build-publish-to-snap-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,72 @@ on:
jobs:
snap-release:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

if: '!github.event.release.prerelease'

steps:
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Check out Git repository
uses: actions/checkout@v4
with:
persist-credentials: false
# work around for npm installs from git+https://github.com/johannesjo/J2M.git
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i

- name: Lint
run: npm run lint

- name: Test Unit
run: npm run test

- name: Test E2E
run: npm run e2e

- name: Build Frontend & Electron
run: npm run build

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

- name: Build/Release Electron app
uses: johannesjo/action-electron-builder@v1
with:
build_script_name: empty
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

- run: snapcraft push app-builds/superProductivity*.snap --release stable
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
- run: yes | snapcraft promote superproductivity --from-channel latest/edge --to-channel latest/stable
env: # Workaround for https://github.com/snapcore/snapcraft/issues/4439
SNAPCRAFT_HAS_TTY: 'true'
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - name: Check out Git repository
# uses: actions/checkout@v4
# with:
# persist-credentials: false
# # work around for npm installs from git+https://github.com/johannesjo/J2M.git
# - name: Reconfigure git to use HTTP authentication
# run: >
# git config --global url."https://github.com/".insteadOf
# ssh://[email protected]/
#
# - name: Get npm cache directory
# id: npm-cache-dir
# run: |
# echo "::set-output name=dir::$(npm config get cache)"
# - uses: actions/cache@v4
# id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
# with:
# path: ${{ steps.npm-cache-dir.outputs.dir }}
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
#
# - name: Install npm Packages
# # if: steps.npm-cache.outputs.cache-hit != 'true'
# run: npm i
#
# - name: Lint
# run: npm run lint
#
# - name: Test Unit
# run: npm run test
#
# - name: Test E2E
# run: npm run e2e
#
# - name: Build Frontend & Electron
# run: npm run build
#
# - name: Install Snapcraft
# uses: samuelmeuli/action-snapcraft@v2
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
#
# - name: Build/Release Electron app
# uses: johannesjo/action-electron-builder@v1
# with:
# build_script_name: empty
# github_token: ${{ secrets.github_token }}
# release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
#
# - run: snapcraft push app-builds/superProductivity*.snap --release stable
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
2 changes: 1 addition & 1 deletion .github/workflows/build-update-web-app-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
env:
SSH_PRIVATE_KEY: ${{ secrets.WEB_SERVER_SSH_KEY }}
ARGS: '-rltgoDzvO --delete --exclude "news.json"'
SOURCE: 'dist/'
SOURCE: 'dist/browser/'
REMOTE_HOST: ${{ secrets.WEB_REMOTE_HOST }}
REMOTE_USER: ${{ secrets.WEB_REMOTE_USER }}
TARGET: ${{ secrets.WEB_REMOTE_TARGET }}
29 changes: 18 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
linux-bin-and-snap-release:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

steps:
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -53,29 +55,28 @@ jobs:

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

- name: Build/Release Electron app
uses: johannesjo/action-electron-builder@v1
with:
build_script_name: empty
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}

# rename to possibly fix release issue
- run: find ./app-builds -type f -name '*.snap' -exec sh -c 'x="{}"; mv "$x" "app-builds/sp.snap"' \;
# Release to edge if no tag and to candidate if tag
- run: snapcraft push app-builds/sp.snap --release edge
- #otherwise it would be executed twice
if: false == startsWith(github.ref, 'refs/tags/v')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
- run: snapcraft push app-builds/sp.snap --release candidate
if: startsWith(github.ref, 'refs/tags/v')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
uses: nick-fields/retry@v3
with:
max_attempts: 2
timeout_minutes: 11
command: snapcraft push app-builds/sp.snap --release edge
# - run: snapcraft push app-builds/sp.snap --release candidate
# if: startsWith(github.ref, 'refs/tags/v')
# - run: snapcraft promote superproductivity --from-channel latest/edge --to-channel latest/candidate --yes
# if: startsWith(github.ref, 'refs/tags/v')

mac-bin:
runs-on: macos-latest
Expand Down Expand Up @@ -112,6 +113,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue and dmg licence issue
run: npm install @nx/nx-darwin-arm64 dmg-license

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand Down Expand Up @@ -194,6 +198,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue
run: npm install @nx/nx-win32-x64-msvc

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue
run: npm install @nx/nx-win32-x64-msvc

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand Down Expand Up @@ -91,6 +94,9 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Workaround for nx issue and dmg licence issue
run: npm install @nx/nx-darwin-arm64 dmg-license

- name: Install npm Packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm i
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-hub-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
images: johannesjo/super-productivity

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/app-builds
/tmp
/out-tsc
/logs

# dependencies
/node_modules
Expand Down
Loading

0 comments on commit cd23263

Please sign in to comment.