diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..9267e7d --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,2 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ +_extends: .github diff --git a/.github/sync.yml b/.github/sync.yml new file mode 100644 index 0000000..6c1f865 --- /dev/null +++ b/.github/sync.yml @@ -0,0 +1,30 @@ +group: + - id: default + files: + - source: workflows/base/basic-linters.yml + dest: .github/workflows/basic-linters.yml + - source: LICENSE + dest: LICENSE + - source: .github/settings.yml + replace: false + repos: |- + valitydev/damsel + valitydev/newway + + - id: proto + files: + - source: workflows/proto/ + dest: .github/workflows/ + deleteOrphaned: true + exclude: | + basic-linters.yml + repos: |- + valitydev/damsel + + - id: java + files: + - source: codeowners/java + dest: CODEOWNERS + replace: false + repos: |- + valitydev/newway diff --git a/.github/workflows/sync-files.yml b/.github/workflows/sync-files.yml new file mode 100644 index 0000000..0c2d594 --- /dev/null +++ b/.github/workflows/sync-files.yml @@ -0,0 +1,20 @@ +name: Sync files +on: + pull_request: + push: + branches: + - master + - main +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code + uses: actions/checkout@v2 + + - name: 🔄 Sync repo files + uses: valitydev/repo-file-sync-action@v1 + with: + GH_PAT: ${{ secrets.GH_PAT }} + GIT_EMAIL: ${{ secrets.GIT_EMAIL }} + BRANCH_PREFIX: update/ diff --git a/.github/workflows/sync-repo-list.yml b/.github/workflows/sync-repo-list.yml new file mode 100644 index 0000000..c4368c1 --- /dev/null +++ b/.github/workflows/sync-repo-list.yml @@ -0,0 +1,83 @@ +name: Sync repo list in sync.yml file + +on: + push: + branches: + - master + - main + schedule: + - cron: 0 * * * * + +env: + repo_limit: 1000 + +jobs: + workflows-sync: + name: Sync repositories for ${{ matrix.group }} group + runs-on: ubuntu-latest + strategy: + matrix: + include: + - group: default + languages: >- + all + + - group: proto + languages: >- + thrift + + - group: java + languages: >- + java + kotlin + steps: + - name: ⤵️ Check out code + uses: actions/checkout@v2 + + - name: 📤 Get a list of repositories for ${{ matrix.group }} group + id: repo-list + run: | + REPOSITORIES="" + for language in ${{ matrix.languages }}; do + LANGUAGE_ARGS="" + if [[ $language != "all" ]]; then + LANGUAGE_ARGS="-l $language" + fi + REPOSITORIES+=$(gh repo list \ + $OWNER \ + --source \ + --no-archived \ + -L $repo_limit \ + $LANGUAGE_ARGS \ + --json name,owner \ + -q '.|=sort_by(.name)| .[] | [.owner.login, .name] | join("/")') + REPOSITORIES+=" " + done + REPOSITORIES=$(echo $REPOSITORIES | sort | uniq | tr " " "\n") + REPOSITORIES="${REPOSITORIES//'%'/'%25'}" + REPOSITORIES="${REPOSITORIES//$'\n'/'%0A'}" + REPOSITORIES="${REPOSITORIES//$'\r'/'%0D'}" + echo "::set-output name=repositories::$REPOSITORIES" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OWNER: ${{ github.repository_owner }} + + - name: 🔄 Update sync.yml file for ${{ matrix.group }} group + uses: fjogeleit/yaml-update-action@master + with: + valueFile: ".github/sync.yml" + propertyPath: >- + $.group[?(@.id == "${{ matrix.group }}")].repos + value: ${{ steps.repo-list.outputs.repositories }} + updateFile: true + commitChange: false + + - name: 📤 Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + base: master + branch: updates/${{ matrix.group }} + title: "Update repo list for ${{ matrix.group }} group" + commit-message: "Update repo list for ${{ matrix.group }} group" + add-paths: | + .github/sync.yml diff --git a/codeowners/java b/codeowners/java new file mode 100644 index 0000000..a2af2fa --- /dev/null +++ b/codeowners/java @@ -0,0 +1 @@ +* @valitydev/java diff --git a/workflows/base/auto-tag.yml b/workflows/base/auto-tag.yml new file mode 100644 index 0000000..04af9d6 --- /dev/null +++ b/workflows/base/auto-tag.yml @@ -0,0 +1,11 @@ +name: Vality auto-tags + +on: + push: + branches: + - "master" + - "main" + +jobs: + tag-action: + uses: valitydev/base-workflows/.github/workflows/auto-tag.yml@v1 diff --git a/workflows/base/basic-linters.yml b/workflows/base/basic-linters.yml new file mode 100644 index 0000000..6114f14 --- /dev/null +++ b/workflows/base/basic-linters.yml @@ -0,0 +1,10 @@ +name: Vality basic linters + +on: + pull_request: + branches: + - "*" + +jobs: + lint: + uses: valitydev/base-workflows/.github/workflows/basic-linters.yml@v1 diff --git a/workflows/proto/erlang-pr.yml b/workflows/proto/erlang-pr.yml new file mode 100644 index 0000000..eee9e65 --- /dev/null +++ b/workflows/proto/erlang-pr.yml @@ -0,0 +1,34 @@ +name: Erlang build + +on: + pull_request: + branches: + - "*" + +jobs: + build: + name: Build and verify + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: valitydev/action-setup-thrift@v1 + + - uses: erlef/setup-beam@v1 + id: beam + with: + otp-version: "24" + rebar3-version: "3.18" + + - name: Restore PLT cache + uses: actions/cache@v2 + id: plt-cache + with: + key: | + ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-plt + path: | + _build/default/rebar3_*_plt + + - run: rebar3 compile + - run: rebar3 xref + - run: rebar3 dialyzer diff --git a/workflows/proto/java-deploy.yml b/workflows/proto/java-deploy.yml new file mode 100644 index 0000000..2cd8c45 --- /dev/null +++ b/workflows/proto/java-deploy.yml @@ -0,0 +1,17 @@ +name: Java deploy + +on: + push: + branches: + - "master" + - "main" + +jobs: + deploy: + uses: valitydev/java-workflow/.github/workflows/maven-thrift-deploy.yml@v1 + secrets: + server-username: ${{ secrets.OSSRH_USERNAME }} + server-password: ${{ secrets.OSSRH_TOKEN }} + deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} diff --git a/workflows/proto/java-pr.yml b/workflows/proto/java-pr.yml new file mode 100644 index 0000000..0db65b3 --- /dev/null +++ b/workflows/proto/java-pr.yml @@ -0,0 +1,10 @@ +name: Java build + +on: + pull_request: + branches: + - "*" + +jobs: + build: + uses: valitydev/java-workflow/.github/workflows/maven-thrift-build.yml@v1