diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..f14f0cc31 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +--- +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps)" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps)" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps)" \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..d0044b6a2 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,68 @@ +--- +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + # Changelog + $CHANGES + + See details of [all code changes](https://github.com/finos/git-proxy/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release + +categories: + - title: ':rocket: Features' + labels: + - 'feature' + - 'enhancement' + - title: ':bug: Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: ':gear: Maintenance' + labels: + - 'infrastructure' + - 'automation' + - 'documentation' + - 'dependencies' + - 'maintenance' + - 'revert' + - title: ':racing_car: Performance' + label: 'performance' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +version-resolver: + major: + labels: + - 'breaking' + minor: + labels: + - 'enhancement' + patch: + labels: + - 'fix' + - 'documentation' + - 'maintenance' + default: patch +autolabeler: + - label: 'automation' + title: + - '/^(build|ci|perf|refactor|test).*/i' + - label: 'enhancement' + title: + - '/^(style).*/i' + - label: 'documentation' + title: + - '/^(docs).*/i' + - label: 'feature' + title: + - '/^(feat).*/i' + - label: 'fix' + title: + - '/^(fix).*/i' + - label: 'infrastructure' + title: + - '/^(infrastructure).*/i' + - label: 'maintenance' + title: + - '/^(chore|maintenance).*/i' + - label: 'revert' + title: + - '/^(revert).*/i' diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 000000000..ae365c4de --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,41 @@ +## Reference: https://github.com/amannn/action-semantic-pull-request +--- +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + contents: read + +jobs: + main: + permissions: + pull-requests: read + statuses: write + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed (newline-delimited). + # From: https://github.com/commitizen/conventional-commit-types/blob/master/index.json + # listing all below + types: | + build + chore + ci + docs + feat + fix + perf + refactor + revert + style + test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..58318675d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +--- +name: Release + +on: + workflow_dispatch: + push: + branches: + - main + +permissions: + contents: read + +jobs: + create_release: + outputs: + full-tag: ${{ steps.release-drafter.outputs.tag_name }} + short-tag: ${{ steps.get_tag_name.outputs.SHORT_TAG }} + body: ${{ steps.release-drafter.outputs.body }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - uses: release-drafter/release-drafter@v6 + id: release-drafter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + config-name: release-drafter.yml + publish: true + - name: Get the short tag + id: get_tag_name + run: | + short_tag=$(echo ${{ steps.release-drafter.outputs.tag_name }} | cut -d. -f1) + echo "SHORT_TAG=$short_tag" >> $GITHUB_OUTPUT + create_action_images: + if: github.event.pull_request.head.repo.full_name == github.repository # Everything but this step can be tested on a fork + needs: create_release + runs-on: ubuntu-latest + permissions: + packages: write + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - uses: actions/checkout@8459bc0 # v4 + - uses: actions/setup-node@c2ac33f # v4, Setup .npmrc file to publish to npm + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}