diff --git a/.github/labels.yml b/.github/labels.yml deleted file mode 100644 index b9e657cc..00000000 --- a/.github/labels.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -- name: auto-changelog - color: e01f96 - description: "Automatic update of changelog file" -- name: auto-documentation - color: cce1ff - description: "Automatic update of documentation files" -- name: auto-update - color: 63d11b - description: "Workflow, documentation templates or configuration files auto-updates" -- name: breaking-change - color: f0ff00 - description: "A breaking change that needs to be treated with consideration" -- name: bug - color: d73a4a - description: "Something isn't working" -- name: dependency-update - color: 27d14f - description: "A dependency version update" -- name: documentation - color: 0075ca - description: "Improvements or additions to documentation" -- name: duplicate - color: cfd3d7 - description: "This issue or pull request already exists" -- name: enhancement - color: a2eeef - description: "New feature or request" -- name: good first issue - color: 7057ff - description: "Good for newcomers" -- name: help wanted - color: 008672 - description: "Extra attention is needed" -- name: invalid - color: e4e669 - description: "This doesn't seem right" -- name: question - color: d876e3 - description: "Further information is requested" -- name: scala-steward - color: c6055c - description: "Dependency auto updates created by scala-steward" -- name: tests - color: 04d1c3 - description: "Improves or modifies tests" -- name: wontfix - color: ffffff - description: "This will not be worked on" \ No newline at end of file diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml index 87e07edd..ea3a0aae 100644 --- a/.github/pr-labeler.yml +++ b/.github/pr-labeler.yml @@ -3,7 +3,9 @@ # If you want to suggest a change, please open a PR or issue in that repository enhancement: ['enhancement/*', 'feature/*'] -documentation: ['docs/*', '.docs/*', 'doc/*'] +documentation: ['docs/*', 'doc/*'] +breaking-change: ['breaking/*', 'break/*'] bug: ['bug/*', 'fix/*'] tests: ['test/*', 'tests/*'] dependency-update: ['dep/*', 'dependency/*', 'dependency-update/*'] +scala-steward: ['update/*'] diff --git a/.github/workflows/bot-prs-auto-approve.yml b/.github/workflows/bot-prs-auto-approve.yml deleted file mode 100644 index bf827d6c..00000000 --- a/.github/workflows/bot-prs-auto-approve.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: Auto Approve bot PRs - -on: - pull_request - -jobs: - auto-approve: - runs-on: ubuntu-latest - steps: - - uses: hmarr/auto-approve-action@v2.0.0 - if: github.actor == '47erbot' - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index 1b9c0fb9..00000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: Update changelog - -on: - push: - tags: - - v** - -jobs: - changelog: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Checkout project - uses: actions/checkout@v2 - with: - ref: master - fetch-depth: 0 - - name: Fetch tags - run: git fetch --tags - - name: Setup ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - name: Install github-changelog-generator - run: gem install github_changelog_generator -v 1.15.0 - - name: Generate changelog - env: - repo: ${{ github.repository }} - run: | - github_changelog_generator \ - --user ${repo%/*} \ - --project ${repo#*/} \ - --token $GITHUB_TOKEN \ - --exclude-labels "duplicate,question,invalid,wontfix,auto-update,auto-changelog,auto-documentation" \ - --max-issues 1000 \ - --configure-sections \ - '{ - "breaking": { - "prefix": "⚠️ **Breaking changes**", - "labels": ["breaking-change"] - }, - "enhancement": { - "prefix": "🚀 **Features**", - "labels": ["enhancement"] - }, - "documentation": { - "prefix": "📘 **Documentation**", - "labels": ["documentation"] - }, - "bug": { - "prefix": "🐛 **Bug Fixes**", - "labels": ["bug"] - }, - "dependency": { - "prefix": "📈 **Dependency updates**", - "labels": ["dependency-update", "scala-steward"] - } - }' - - name: Create Changelog Pull Request - uses: peter-evans/create-pull-request@v2 - with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - commit-message: Update CHANGELOG.md [ci skip] - title: 'Update CHANGELOG.md' - labels: auto-changelog - branch: auto-update-changelog - body: Update CHANGELOG.md with information from latest release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78f8c4c8..84286456 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,48 +11,42 @@ on: jobs: test: + if: "!contains(github.event.head_commit.message, 'skip ci')" runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} - REQUIRES_JEKYLL_CI: ${{secrets.REQUIRES_JEKYLL_CI}} - REQUIRES_CODECOV: ${{secrets.REQUIRES_CODECOV}} steps: - name: Checkout project uses: actions/checkout@v2 with: - fetch-depth: 0 - - name: Fetch tags - run: git fetch --tags - - name: Set up Ruby 2.6 - uses: actions/setup-ruby@v1 - with: - ruby-version: 2.6 - - name: Set up jekyll - if: env.REQUIRES_JEKYLL_CI != null - run: | - gem install jekyll -v 4 - - name: Set up codecov - if: env.REQUIRES_CODECOV != null - run: | - curl -s https://codecov.io/bash > .codecov - chmod +x .codecov + ref: ${{ github.head_ref }} + - name: Label PR + if: github.event_name == 'pull_request' + uses: TimonVS/pr-labeler-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup Scala uses: olafurpg/setup-scala@v7 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/coursier/v1 - key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-coursier- - - name: Cache .sbt - uses: actions/cache@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + - name: Setup yq + run: sudo snap install yq + - name: Run pre-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" pre.ci)" || true + - name: Run scalafmt on Scala Steward PRs + if: github.event.pull_request.user.login == '47erbot' && contains(github.event.pull_request.body, 'Scala Steward') + run: sbt "scalafixEnable; fix" || sbt "scalafmtAll; scalafmtSbt" || true + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4.1.3 with: - path: ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-sbt- + commit_message: Run formatter/linter - name: Run checks run: sbt ci-test - - name: Upload codecov reports - if: env.REQUIRES_CODECOV != null - run: | - ./.codecov -X gcov + env: + GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} + - name: Run post-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" post.ci)" || true + - name: Automerge Scala Steward PRs + if: success() && github.event_name == 'pull_request' && contains(github.event.pull_request.body, 'Scala Steward') + uses: ridedott/merge-me-action@v1.1.36 + with: + GITHUB_LOGIN: 47erbot + GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7a72f263..53c943f3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,47 +5,74 @@ name: Update documentation on: - push: - branches: master - tags: v** + release: + types: [published] + repository_dispatch: + types: [docs] jobs: documentation: + if: "!contains(github.event.head_commit.message, 'skip ci')" runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} steps: - name: Checkout project uses: actions/checkout@v2 with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} ref: master - fetch-depth: 0 - name: Fetch tags run: git fetch --tags - name: Setup Scala uses: olafurpg/setup-scala@v7 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/coursier/v1 - key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-coursier- - - name: Cache .sbt - uses: actions/cache@v1 - with: - path: ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-sbt- + - name: Setup Ruby + uses: actions/setup-ruby@v1 + - name: Setup github-changelog-generator + run: gem install github_changelog_generator -v 1.15.0 + - name: Setup yq + run: sudo snap install yq + - name: Run pre-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" pre.docs)" || true - name: Generate documentation run: sbt ci-docs env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOWNLOAD_INFO_FROM_GITHUB: true - - name: Create Documentation Pull Request - uses: peter-evans/create-pull-request@v2 + - name: Run post-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" post.docs)" || true + - name: Generate changelog + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + repo: ${{ github.repository }} + run: | + github_changelog_generator \ + --user ${repo%/*} \ + --project ${repo#*/} \ + --token $GITHUB_TOKEN \ + --exclude-labels "duplicate,question,invalid,wontfix,auto-update,auto-changelog,auto-documentation" \ + --configure-sections \ + '{ + "breaking": { + "prefix": "⚠️ **Breaking changes**", + "labels": ["breaking-change"] + }, + "enhancement": { + "prefix": "🚀 **Features**", + "labels": ["enhancement"] + }, + "documentation": { + "prefix": "📘 **Documentation**", + "labels": ["documentation"] + }, + "bug": { + "prefix": "🐛 **Bug Fixes**", + "labels": ["bug"] + }, + "dependency": { + "prefix": "📈 **Dependency updates**", + "labels": ["dependency-update", "scala-steward"] + } + }' + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4.1.3 with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - commit-message: Update documentation and other files - title: 'Update documentation and other files' - labels: auto-documentation - branch: auto-update-docs - body: Update documentation and other files with latest changes. + commit_message: 'Update documentation, changelog and other files [skip ci]' \ No newline at end of file diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml deleted file mode 100644 index be1bd145..00000000 --- a/.github/workflows/pr-labeler.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: PR Labeler -on: - pull_request: - types: [opened] - -jobs: - pr-labeler: - runs-on: ubuntu-latest - steps: - - name: Label PR - uses: TimonVS/pr-labeler-action@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish-microsite.yml b/.github/workflows/publish-microsite.yml deleted file mode 100644 index 63cb2cde..00000000 --- a/.github/workflows/publish-microsite.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: Publish Microsite - -on: - push: - tags: v** - -jobs: - microsite: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REQUIRES_PUBLISH_MICROSITE: ${{secrets.REQUIRES_PUBLISH_MICROSITE}} - steps: - - name: Checkout project - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Setup Scala - uses: olafurpg/setup-scala@v7 - - name: Set up Ruby 2.6 - uses: actions/setup-ruby@v1 - with: - ruby-version: 2.6 - - name: Set up jekyll - if: env.REQUIRES_PUBLISH_MICROSITE != null - run: | - gem install jekyll -v 4 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/coursier/v1 - key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-coursier- - - name: Cache .sbt - uses: actions/cache@v1 - with: - path: ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-sbt- - - name: Publish Microsite - if: env.REQUIRES_PUBLISH_MICROSITE != null - run: sbt ci-microsite diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index fa43efbf..d4c81be8 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,8 +1,4 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: Release Drafter +name: Drafts/updates the next repository release on: push: @@ -13,7 +9,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - name: Update release draft - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v5 env: GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de3aaeac..ff0b32f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,21 +5,15 @@ name: Release on: + release: + types: [published] push: branches: master - tags: v** jobs: release: + if: "!contains(github.event.head_commit.message, 'skip ci')" runs-on: ubuntu-latest - env: - DOWNLOAD_INFO_FROM_GITHUB: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - REQUIRES_PUBLISH_MICROSITE: ${{secrets.REQUIRES_PUBLISH_MICROSITE}} steps: - name: Checkout project uses: actions/checkout@v2 @@ -29,20 +23,21 @@ jobs: run: git fetch --tags - name: Setup Scala uses: olafurpg/setup-scala@v7 + - name: Setup Ruby + uses: actions/setup-ruby@v1 - name: Setup GPG uses: olafurpg/setup-gpg@v2 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.cache/coursier/v1 - key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-coursier- - - name: Cache .sbt - uses: actions/cache@v1 - with: - path: ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }} - restore-keys: ${{ runner.os }}-sbt- + - name: Setup yq + run: sudo snap install yq + - name: Run pre-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" pre.release)" || true - name: Release new version - if: env.SONATYPE_USERNAME != null - run: sbt ci-release + run: sbt ci-publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + - name: Run post-conditions + run: test -f .github/actions.yml && eval "$(yq r .github/actions.yml -D "true" post.release)" || true diff --git a/.github/workflows/scalasteward-auto-approve.yml b/.github/workflows/scalasteward-auto-approve.yml deleted file mode 100644 index e5e9a97e..00000000 --- a/.github/workflows/scalasteward-auto-approve.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Auto Approve scala-steward PRs - -on: - pull_request - -jobs: - auto-approve: - runs-on: ubuntu-latest - steps: - - uses: hmarr/auto-approve-action@v2.0.0 - if: github.actor == 'scala-steward' - with: - github-token: "${{ secrets.ADMIN_GITHUB_TOKEN }}" diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml deleted file mode 100644 index 8130f601..00000000 --- a/.github/workflows/update-labels.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -name: Github Labeler - -on: - push: - paths: - - '.github/labels.yml' - -jobs: - github-labeler: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Github Labeler - uses: crazy-max/ghaction-github-labeler@v1.1.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 9103531d..00000000 --- a/.mergify.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Don't edit this file! -# It is automatically updated after every release of https://github.com/47degrees/.github -# If you want to suggest a change, please open a PR or issue in that repository - -pull_request_rules: - - name: automatically merge & label scala-steward's PRs - conditions: - - author=scala-steward - - status-success=test - actions: - merge: - method: squash - label: - add: [scala-steward] - - name: automatically merge & label 47erbot's PRs - conditions: - - author=47erbot - - status-success=test - actions: - merge: - method: squash - - name: delete head branch after merge - conditions: - - merged - actions: - delete_head_branch: {} diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 1cf05d1e..1ef5b2b8 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -11,7 +11,7 @@ appearance, body size, race, ethnicity, age, religion, nationality, or other such characteristics. Everyone is expected to follow the -[Scala Code of Conduct](https://typelevel.org/code-of-conduct.html) when +[Scala Code of Conduct](https://www.scala-lang.org/conduct/) when discussing the project on the available communication channels. If you are being harassed, please contact us immediately so that we can support you.