Skip to content

Commit

Permalink
Merge branch 'italia-opensource:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ViseLuca authored Jun 5, 2024
2 parents c48a41f + ec5cf07 commit afa44bb
Show file tree
Hide file tree
Showing 120 changed files with 34,840 additions and 1,482 deletions.
2 changes: 1 addition & 1 deletion .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ firstPRWelcomeComment: >
Thanks for opening this pull request! Please check out our contributing guidelines.
verifyTitles:
titleRegexp: ^(feat|feat!|fix|fix!|docs|refactor|refactor!|test|chore|build|ci)\((ci|docs|deps|deps-dev|awesome|companies|communities|opensource|digital-nomads)\):.*
titleRegexp: ^(feat|feat!|fix|fix!|docs|refactor|refactor!|test|chore|build|ci)\((release|docs|deps|deps-dev|awesome|companies|communities|opensource|digital-nomads)\):.*
alwaysUsePrTitle: true
validateEitherPrOrSingleCommitTitle: true
statusTitle: "Title Validator"
Expand Down
89 changes: 43 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Release

env:
AWS_REGION: ${{ vars.AWS_REGION }}

permissions:
id-token: write
contents: write
Expand All @@ -12,81 +9,81 @@ on:
branches:
- main
paths:
- '.github/workflows/release.yml'
- 'awesome/**'
- ".github/workflows/release.yml"
- "awesome/**"
schedule:
- cron: "0 9 15 * *" # every 15th of the month at 9:00 AM UTC
workflow_dispatch:

inputs:
with_analytics:
description: "Render awesome data with analytics"
required: false
default: "true"

jobs:
render-data:
name: Render Data
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ROLE_NAME }}
aws-region: ${{ env.AWS_REGION }}
mask-aws-account-id: no

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.12"
cache: "pip"

- name: Setup
- name: Setup CI
run: |
make setup-ci
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v35
with:
files: |
awesome/opensource/data/*.json
awesome/companies/data/*.json
awesome/communities/data/*.json
awesome/digital-nomads/data/*.json
- name: Render awesome data
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.with_analytics == 'false')
run: |
make release ARGS=--without-analytics
- name: Notify SQS
- name: Render awesome with analytics data
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.with_analytics == 'true')
env:
SQS_URL_DATA_INGESTION: ${{ secrets.SQS_URL_DATA_INGESTION }}
TOKEN_GITHUB_PUBLIC_API: ${{ secrets.TOKEN_GITHUB_PUBLIC_API }}
run: |
python3 scripts/notify.py --changed-files '${{ toJSON(steps.changed-files-specific.outputs) }}'
make release
- name: Render awesome README.md
run: |
python3 scripts/render.py
git config --global user.email "${{ secrets.ACTION_EMAIL }}"
git config --global user.name "FabrizioCafolla"
if [ -z "$(git status --porcelain)" ]; then
echo "Nothing to update"
else
git add awesome/**/README.md
git commit -m "release(awesome): Update README.md"
git add analytics/*
git commit -m "release(awesome): update awesome data"
git push
fi
- name: Trigger deployment workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.ACTION_WORKFLOWS }}
retries: 3
script: |
const owner = 'italia-opensource';
const repo = 'infrastructure';
const event_type = 'deployment';
const ref = 'main';
github-token: ${{ secrets.ACTION_WORKFLOWS }}
retries: 3
script: |
const owner = 'italia-opensource';
const repo = 'italiaopensource.com';
const event_type = 'sync-database';
const ref = 'main';
const client_payload = {
"hash": "${{ github.sha }}",
"run_id": "${{ github.run_id }}",
};
github.rest.repos.createDispatchEvent({
owner,
repo,
event_type
});
github.rest.repos.createDispatchEvent({
owner,
repo,
event_type,
client_payload
});
25 changes: 16 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,31 @@ on:
branches:
- main
paths:
- '.github/workflows/test.yml'
- 'awesome/**'
- ".github/workflows/test.yml"
- "awesome/**"
- "scheme/**"
- "scripts/render.py"
- "scripts/check.py"
types: [opened, synchronize]

jobs:
test-data:
name: Test Data
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.12"
cache: "pip"

- name: Setup and test
- name: Setup CI
run: |
make setup-ci
make lint
- name: Test awesome data
run: |
make test
24 changes: 14 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@ default_language_version:
default_stages: [commit, push]

repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: debug-statements
- id: requirements-txt-fixer
- id: double-quote-string-fixer
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
hooks:
- id: autopep8
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.12.0]
additional_dependencies: [flake8-typing-imports==1.15.0]
args: # arguments to configure flake8
# making isort line length compatible with black
- "--max-line-length=88"
Expand Down
46 changes: 35 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We have three type of issues:

1. Bug report
2. Feature request
2. Question
3. Question

## How To Contribute with PRs

Expand All @@ -27,13 +27,16 @@ Projects entered must be maintained and have guidelines and/or documentation for
1. Open `awesome/{companies,opensource,communities,digital-nomads}/data` directory
2. Add a new JSON file for the new project (file name should be a slugified version of the project name)
3. File content should respect json rule
4. Before commit exec
```
4. (Optional) Before commit exec

```bash
make setup
source .activate
make lint
make lint check-data
```

5. if the tests are passed successfully create PR on GitHub, the title should be `feat(type): added/updated Name`
**WARNING *type*** must be: companies, opensource, communities or digital-nomads)

**ATTENTION** do not modify any README.md file.

Expand Down Expand Up @@ -132,13 +135,34 @@ Schema reference: [companies.json](https://github.com/italia-opensource/awesome-

### Online one-click setup for contributing

Reuirements:
|Reuirements|Version|
|---|---|
|Python| >= 3.10|
|Makefile| |

**Setup local env**:

```bash
git clone https://github.com/italia-opensource/awesome-italia-opensource.git

cd awesome-italia-opensource

run make setup
run source .activate

make test
```

- Python >= 3.6
- utils: make, pip3
**Create Analytics**:

Setup env:
1. Create GitHub PAT [here](https://github.com/settings/tokens?type=beta)
1. Add **Repository access** > `Public Repositories (read-only)`
2. Save and copy token
2. Run:

- clone the awesome-italia-opensource repostory.
- run `make setup`
- run `source .activate`
```bash
echo "export TOKEN_GITHUB_PUBLIC_API=_YOUR_TOKEN_" > .env
source .activate
make test
make process-data
```
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
.PHONY: help

help: ## helper
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
help: ## Helper
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\n\t/'

.DEFAULT_GOAL := help

setup:
setup: ## Setup local environment
chmod -R +x ./scripts/dev.sh && ./scripts/dev.sh

setup-ci:
setup-ci: ## Setup CI environment
pip3 install -r requirements.txt && pre-commit install

lint:
pre-commit run --all-files && python3 scripts/check.py && python3 scripts/render.py
lint: ## Run linter on all files
pre-commit run --all-files

check-data: ## Validate awesome data with jsonschema
python3 scripts/check.py

process-data: ## Genereta anayltics from awesome data
python3 scripts/process.py $(ARGS)

render-data: ## Render awesome data to README.md
python3 scripts/render.py

test: lint check-data render-data ## Run all tests

release: check-data process-data render-data ## Release
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

![Last Commit](https://img.shields.io/github/last-commit/italia-opensource/awesome-italia-opensource/main)

**Italy Open-Source** is a project whose purpose is to give transparency to the Italian tech ecosystem.

The **only fully open-source platform** that transparently gives voice, discovers, and explores **Italy's tech innovations**.

Through a series of **awesome** lists, we seek to give visibility to open-source projects, communities, tech blogs, innovative companies, and more.
Through a series of **awesome lists**, we seek to give visibility to open-source Projects, Communities, Tech blogs, Innovative companies, and more.

Transparently, you can access, add, or modify the data in the repository, respecting the contribution conduct criteria.
Feel free to make your contribution. If you want to add a new item to one or more lists please read the [contribution guidelines](https://github.com/italia-opensource/awesome-italia-opensource/blob/main/CONTRIBUTING.md) before opening a pull request or contributing to this repository

### 🚀 Website view
### 🟢 Website

[italiaopensource.com](https://italiaopensource.com)


### ☀️ Awesome Lists

- [List of Open-source projects](https://github.com/italia-opensource/awesome-italia-opensource/blob/main/awesome/opensource/README.md)
Expand All @@ -25,25 +23,28 @@ Transparently, you can access, add, or modify the data in the repository, respec

- [List of Tech Companies](https://github.com/italia-opensource/awesome-italia-opensource/blob/main/awesome/companies/README.md)

### ❤️ Maintained by [Fabrizio Cafolla](https://github.com/FabrizioCafolla)

<a href="https://opencollective.com/italia-open-source/donate" target="_blank">
<img src="https://opencollective.com/italia-open-source/donate/[email protected]?color=blue" width=200 />
</a>
### 📊 Analytics

In the [analytics/](analytics) folder, you will find all the aggregated data for each awesome list. This will allow you to access the data to download and use it most easily.

### 🔥 Contributors
The aggregated file of open-source projects also contains statistical data and metadata retrieved via API from GitHub, allowing you to have a complete overview.

Please read the [contribution guidelines](https://github.com/italia-opensource/awesome-italia-opensource/blob/main/CONTRIBUTING.md) before opening a pull request or contributing to this repository
### 🔥 Our Contributors

<a href="https://github.com/italia-opensource/awesome-italia-opensource/graphs/contributors"> <img src="https://contrib.rocks/image?repo=italia-opensource/awesome-italia-opensource" /> </a>

### ❤️ Support us

### Join with us
<a href="https://opencollective.com/italia-open-source/donate" target="_blank">
<img src="https://opencollective.com/italia-open-source/donate/[email protected]?color=blue" width=200 />
</a>

### Join with us

[![LinkedIn](https://img.shields.io/badge/Linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/italia-open-source)

[![Telegram](https://img.shields.io/badge/Telegram-229ED9?style=for-the-badge&logo=telegram&logoColor=white)](https://t.me/+WsJ91uPMVbUzZjk0)

### License

The project is made available under the GPL-3.0 license. See the `LICENSE` file for more information.
Loading

0 comments on commit afa44bb

Please sign in to comment.