Skip to content

Commit

Permalink
ci: better workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Jun 7, 2024
1 parent 5323c43 commit bf23e26
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .github/dependabot.yml
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
open-pull-requests-limit: 20
schedule:
interval: "weekly"
day: friday
time: '04:00'

- package-ecosystem: "docker"
directory: "/"
open-pull-requests-limit: 20
schedule:
interval: "weekly"
day: friday
time: '04:10'

- package-ecosystem: "pip"
directory: "/"
open-pull-requests-limit: 20
schedule:
interval: "weekly"
day: friday
time: '04:20'
78 changes: 78 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
template: |
## What's Changed
$CHANGES
## Full Changelog
- https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
name-template: "Version $RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"

categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'feat'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '📚 Documentation'
label: 'docs'
- title: '🧪 Tests'
label: 'test'
- title: '🏷️ Version Tags'
label: 'version'
- title: '🔖 Release Tags'
label: 'release'
- title: '🧩 Dependencies'
label: 'dependencies'
- title: '🔒 Security'
label: 'security'
- title: '🚨 Breaking Changes'
label: 'breaking'
- title: '🧹 Code Cleanup'
label: 'cleanup'
- title: '🔧 Config'
label: 'config'
- title: '📦 Packages'
label: 'package'
- title: '🔥 Removals'
label: 'removal'
- title: '🚧 Work In Progress'
label: 'wip'
- title: '🔀 Merges'
label: 'merge'
- title: '🎨 Style'
label: 'style'
- title: '🔊 Logging'
label: 'logging'
- title: '🔇 Silence'
label: 'silence'
- title: '🤖 CI/CD'
label: 'ci'

version-resolver:
major:
labels:
- "release-major"
minor:
labels:
- "release-minor"
patch:
labels:
- "release-patch"
default: patch

autolabeler:
- label: "release-major"
title:
- "/^BREAKING CHANGE:/"
- label: "release-minor"
title:
- "/^feat:/"
- "/^feat\\(.+\\):/"
22 changes: 22 additions & 0 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pull request - Continuous Integration

on:
pull_request:
branches:
- main
- master

jobs:

pull-request-labeler:
name: Pull request labeler
runs-on: self-hosted
permissions:
contents: write
pull-requests: write
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ github.token }}
with:
disable-releaser: true
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 🚀 Release

on:
workflow_dispatch:

jobs:

check-branches:
name: Check branches
runs-on: self-hosted
steps:
- name: Check branch
run: |
if [[ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]]; then
echo "This action can only be run on the ${{ github.event.repository.default_branch }} branch"
exit 1
fi
update_release_draft:
name: Draft a new release
# we want to publish a new tag only if ci succeeds
needs: check-branches
permissions:
contents: write
pull-requests: write
runs-on: self-hosted
outputs:
latestRelease: ${{ steps.update_release_draft.outputs.tag_name }}
steps:
# create a new release
- id: update_release_draft
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ github.token }}
with:
publish: true
disable-autolabeler: true
20 changes: 20 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: self-hosted

steps:
- uses: actions/[email protected]
with:
repo-token: ${{ github.token }}
stale-issue-message: "This issue is stale"
stale-pr-message: "This PR is stale"
stale-issue-label: "no-issue-activity"
exempt-issue-labels: "awaiting-approval,work-in-progress"
stale-pr-label: "no-pr-activity"
exempt-pr-labels: "awaiting-approval,work-in-progress"
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Tests

on: [push]
on:
- push
- pull_request

jobs:
build:
Expand Down

0 comments on commit bf23e26

Please sign in to comment.