-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from github/jm-automated-releases
feat: add automated release and labelling
- Loading branch information
Showing
8 changed files
with
172 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
autolabeler: | ||
- label: 'automation' | ||
title: | ||
- '/^(build|ci|perf|refactor|test).*/i' | ||
- label: 'enhancement' | ||
title: | ||
- '/^(chore|style).*/i' | ||
- label: 'documentation' | ||
title: | ||
- '/^docs.*/i' | ||
- label: 'feature' | ||
title: | ||
- '/^feat.*/i' | ||
- label: 'fix' | ||
title: | ||
- '/^fix.*/i' | ||
- label: 'infrastructure' | ||
title: | ||
- '/^infrastructure.*/i' | ||
- label: 'revert' | ||
title: | ||
- '/^revert.*/i' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Auto Labeler | ||
|
||
on: | ||
# pull_request event is required only for autolabeler | ||
pull_request: | ||
# Only following types are handled by the action, but one can default to all as well | ||
types: [opened, reopened, synchronize] | ||
# pull_request_target event is required for autolabeler to support PRs from forks | ||
pull_request_target: | ||
types: [opened, reopened, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
main: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
name: Auto label pull requests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
config-name: auto-labeler.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
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 }} | ||
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: | ||
needs: create_release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push Docker Image | ||
if: ${{ success() }} | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create_release.outputs.full-tag }} | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create_release.outputs.short-tag }} | ||
platforms: linux/amd64,linux/arm64 | ||
provenance: false | ||
sbom: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters