Skip to content

Commit

Permalink
chore: prepare migration to monica repository (monicahq/chandler#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jun 2, 2023
1 parent d59a7d9 commit aaea1e3
Show file tree
Hide file tree
Showing 15 changed files with 361 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ composer_install() {
}

yarn_install() {
yarn install --frozen-lockfile
yarn install --immutable
yarn run build
}

Expand Down
9 changes: 8 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
/.github export-ignore
/.platform export-ignore
/.vscode export-ignore
/tests export-ignore
/scripts export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.releaserc export-ignore
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [djaiss, asbiin]
patreon: monicahq
2 changes: 1 addition & 1 deletion .github/workflows/build_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
${{ runner.os }}-yarn-v2-
- name: Install yarn dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Build assets
run: yarn run build
2 changes: 1 addition & 1 deletion .github/workflows/lint_vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-yarn-v2-
- name: Install yarn dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Run eslint
run: yarn run lint --fix
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lock Threads
# See https://github.com/dessant/lock-threads

on:
schedule:
- cron: '0 0 * * *'

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
github-token: ${{ github.token }}
exclude-any-issue-labels: retained
issue-comment: |
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
exclude-any-pr-labels: wip
pr-comment: |
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
event-type: ${{ secrets.EVENT_TYPE }}
repository: ${{ secrets.REPO_URL }}
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "repository": "${{ github.repository }}"}'
162 changes: 162 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Release

on:
pull_request:
branches-ignore: ['*']
push:
branches:
- next
- next-major
- beta
- alpha

workflow_dispatch:

env:
php-version: '8.2'
build-node-version: 18
semantic-node-version: 18

jobs:
####################
# Semantic release
####################
semantic:
runs-on: ubuntu-latest
name: Semantic release
if: github.event_name != 'pull_request'

outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ steps.semantic.outputs.new_release_version }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Get all tags

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.semantic-node-version }}

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN_RELEASE: ${{ secrets.GH_TOKEN_RELEASE }}
with:
semantic_version: 19
extra_plugins: |
conventional-changelog-conventionalcommits@5.0.0
@semantic-release/changelog@6
- name: New release published
if: steps.semantic.outputs.new_release_published == 'true'
run: echo "### Release ${{ steps.semantic.outputs.new_release_version }} created :rocket:" >> $GITHUB_STEP_SUMMARY

- name: Store changelog file
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/upload-artifact@v3
with:
name: changelog
path: CHANGELOG.md

package:
needs: semantic
runs-on: ubuntu-latest
name: Package release
if: needs.semantic.outputs.new_release_published == 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: v${{ needs.semantic.outputs.new_release_version }}
- name: Download changelog file
uses: actions/download-artifact@v3
with:
name: changelog

- name: Setup PHP ${{ env.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
coverage: none

# Composer
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
${{ runner.os }}-composer-${{ matrix.php-version }}
${{ runner.os }}-composer-
# Yarn
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node-version }}
- name: Cache yarn files
uses: actions/cache@v3
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v2-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-v2-
- name: Import key
run: echo -e "$GPG_KEY" | gpg --batch --yes --import -
env:
GPG_KEY: ${{ secrets.GPG_KEY }}

- name: Create package
id: package
run: scripts/ci/package.sh 'v${{ needs.semantic.outputs.new_release_version }}' $GITHUB_SHA
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}

- name: Publish package
run: |
for f in {${{ steps.package.outputs.package }},${{ steps.package.outputs.assets }}}{,.asc,.sha512,.sha512.asc}; do
echo "Uploading release file '$f'…"
gh release upload 'v${{ needs.semantic.outputs.new_release_version }}' "$f" --clobber
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store package
uses: actions/upload-artifact@v3
with:
name: package
path: ${{ steps.package.outputs.package }}

- name: Store assets
uses: actions/upload-artifact@v3
with:
name: assets
path: ${{ steps.package.outputs.assets }}

docker-workflow:
needs: [semantic, package]
runs-on: ubuntu-latest
name: Docker release create
if: needs.semantic.outputs.new_release_published == 'true'

steps:
- name: Dispatch docker release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Release update
repo: monicahq/docker
token: ${{ secrets.DOCKER_GITHUB_TOKEN }}
13 changes: 11 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,24 @@ jobs:
SONAR_COVERAGE=$(ls -m --format=comma results/${{ env.coverage-with }}/coverage/coverage*.xml | sed -e ':a;N;$!ba;s/\n//g; s/ //g;')
echo "list=$SONAR_COVERAGE" >> $GITHUB_OUTPUT
- name: Set project key
id: projectkey
run: |
if [[ "${{ github.repository }}" == "monicahq/chandler" ]]; then
echo "value=monicahq_chandler" >> $GITHUB_OUTPUT
elif [[ "${{ github.repository }}" == "monicahq/monica" ]]; then
echo "value=monica" >> $GITHUB_OUTPUT
fi
- name: SonarCloud Scan
if: env.SONAR_TOKEN != ''
uses: SonarSource/sonarcloud-github-action@v1.8
uses: SonarSource/sonarcloud-github-action@v1.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: |
-Dsonar.projectKey=monicahq_chandler
-Dsonar.projectKey=${{ steps.projectkey.outputs.value }}
-Dsonar.organization=monicahq
-Dsonar.sources=app,bootstrap,config,database,public,resources,routes
-Dsonar.exclusions=bootstrap/cache/*,public/vendor/**,resources/lang/**
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/bootstrap/ssr
/config/.commit
/config/.release
/config/.version
/data.ms
/lang/php_*.json
/node_modules
Expand Down
37 changes: 37 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"branches": [
"main",
"next",
"next-major",
{"name": "beta", "prerelease": true},
{"name": "alpha", "prerelease": true}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{"scope": "no-release", "release": false}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"writerOpts": {
"commitGroupsSort": ["feat"],
"commitsSort": ["scope", "subject"]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/github"
]
}
3 changes: 3 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
php 8.2.0
nodejs 18.16.0
yarn 1.22.19
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

The software is called Monica and is a personal relationship management system.
Copyright (C) 2016-2022 Maazarin
Copyright (C) 2016-2023 Maazarin & asbin

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Reporting a Vulnerability

If you discover any security related issues, please email security@monicahq.com instead of using the issue tracker.
Loading

0 comments on commit aaea1e3

Please sign in to comment.