-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
118 changed files
with
4,617 additions
and
7,363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.editorconfig | ||
logs | ||
.venv | ||
start | ||
config.yaml | ||
registration.yaml | ||
*.db | ||
*.pickle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
indent_style = tab | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.py] | ||
max_line_length = 99 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# Indentation override for all JSON/YAML files | ||
[*.{json,yaml,yml}] | ||
[*.{yaml,yml,sql}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{.gitlab-ci.yml,.github/workflows/*.yml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Bug report | ||
about: If something is definitely wrong in the bridge (rather than just a setup issue), | ||
file a bug report. Remember to include relevant logs. | ||
labels: bug | ||
|
||
--- | ||
|
||
<!-- | ||
Remember to include relevant logs, the bridge version and any other details. | ||
If you aren't sure what's needed, ask in the Matrix room rather than opening an | ||
incomplete issue. Issues with insufficient detail will likely just be ignored. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
contact_links: | ||
- name: Troubleshooting docs & FAQ | ||
url: https://docs.mau.fi/bridges/general/troubleshooting.html | ||
about: Check this first if you're having problems setting up the bridge. | ||
- name: Support room | ||
url: https://matrix.to/#/#linkedin-matrix:nevarro.space | ||
about: For setup issues not answered by the troubleshooting docs, ask in the Matrix room. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
name: Enhancement request | ||
about: Submit a feature request or other suggestion | ||
labels: enhancement | ||
|
||
--- |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lint, Build, and Deploy | ||
name: Lint & Deploy | ||
|
||
on: | ||
push: | ||
|
@@ -10,64 +10,96 @@ on: | |
- created | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
BEEPER_BRIDGE_TYPE: linkedin | ||
CI_REGISTRY_IMAGE: "${{ secrets.CI_REGISTRY }}/bridge/linkedin" | ||
GHCR_REGISTRY: ghcr.io | ||
GHCR_REGISTRY_IMAGE: "ghcr.io/${{ github.repository }}" | ||
BINARY_NAME: linkedin-matrix | ||
|
||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- uses: isort/isort-action@master | ||
with: | ||
sortPaths: "./linkedin_matrix" | ||
- uses: psf/black@stable | ||
with: | ||
src: "./linkedin_matrix" | ||
version: "22.3.0" | ||
- name: pre-commit | ||
run: | | ||
pip install pre-commit | ||
pre-commit run -av trailing-whitespace | ||
pre-commit run -av end-of-file-fixer | ||
pre-commit run -av check-yaml | ||
pre-commit run -av check-added-large-files | ||
test: | ||
name: Run the tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [ "1.22", "1.23.2" ] | ||
name: Lint ${{ matrix.go-version == '1.23.2' && '(latest)' || '(old)' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r dev-requirements.txt | ||
- name: Install libolm | ||
run: sudo apt-get install libolm-dev libolm3 | ||
|
||
- name: Run pytest | ||
- name: Install dependencies | ||
run: | | ||
pytest -vv | ||
pytest -vv > pytest-coverage.txt | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
export PATH="$HOME/go/bin:$PATH" | ||
- name: Comment coverage | ||
uses: coroo/[email protected] | ||
if: ${{ github.event_name == 'pull_request' && github.event.action == 'created' }} | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
env: | ||
GOPATH: ${{ github.workspace }}/.cache | ||
GOCACHE: ${{ github.workspace }}/.cache/build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.23.2" | ||
cache: true | ||
|
||
- name: Create cache directory | ||
run: mkdir -p .cache | ||
|
||
- name: Get Mautrix Version | ||
id: mautrix_version | ||
run: echo "MAUTRIX_VERSION=$(grep 'maunium.net/go/mautrix ' go.mod | awk '{ print $2 }')" >> $GITHUB_ENV | ||
|
||
- name: Set LDFLAGS | ||
run: | | ||
echo "GO_LDFLAGS=-s -w -linkmode external -extldflags '-static' \ | ||
-X main.Tag=${{ github.ref_name }} -X main.Commit=${{ github.sha }} \ | ||
-X 'main.BuildTime=`date -Iseconds`' \ | ||
-X 'maunium.net/go/mautrix.GoModVersion=${{ env.MAUTRIX_VERSION }}'" >> $GITHUB_ENV | ||
- name: Build binary | ||
run: go build -ldflags "$GO_LDFLAGS" -o $BINARY_NAME ./cmd/$BINARY_NAME | ||
|
||
- name: Generate SHA256 checksum | ||
run: sha256sum $BINARY_NAME | tee $BINARY_NAME.sha256sum | ||
|
||
- name: Upload binary artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: $BINARY_NAME | ||
path: $BINARY_NAME | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download binary artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: $BINARY_NAME | ||
path: ./ | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
@@ -100,9 +132,7 @@ jobs: | |
|
||
deploy-docker: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint | ||
- build-docker | ||
needs: build-docker | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Login to Beeper Docker registry | ||
|
@@ -138,18 +168,6 @@ jobs: | |
BEEPER_STAGING_ADMIN_NIGHTLY_PASS: "${{ secrets.BEEPER_STAGING_ADMIN_NIGHTLY_PASS }}" | ||
BEEPER_PROD_ADMIN_NIGHTLY_PASS: "${{ secrets.BEEPER_PROD_ADMIN_NIGHTLY_PASS }}" | ||
|
||
publish-pypi: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish to pypi | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
tag-docker-release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Lock old issues' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 18 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
# pull-requests: write | ||
# discussions: write | ||
|
||
concurrency: | ||
group: lock-threads | ||
|
||
jobs: | ||
lock-stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/lock-threads@v5 | ||
id: lock | ||
with: | ||
issue-inactive-days: 90 | ||
process-only: issues | ||
- name: Log processed threads | ||
run: | | ||
if [ '${{ steps.lock.outputs.issues }}' ]; then | ||
echo "Issues:" && echo '${{ steps.lock.outputs.issues }}' | jq -r '.[] | "https://github.com/\(.owner)/\(.repo)/issues/\(.issue_number)"' | ||
fi |
Oops, something went wrong.