Skip to content

Commit

Permalink
Merge pull request #534 from eddie-knight/releaser
Browse files Browse the repository at this point in the history
Releaser
  • Loading branch information
JamieSlome authored May 10, 2024
2 parents 6ddc713 + 538a9a4 commit e6eec8e
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
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: '🚀 Features'
labels:
- 'enhancement'
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- title: '🧰 Maintenance'
labels:
- 'infrastructure'
- 'automation'
- 'documentation'
- 'dependencies'
- 'maintenance'
- 'revert'
version-resolver:
major:
labels:
- 'breaking'
minor:
labels:
- 'enhancement'
- 'feature'
patch:
labels:
- 'fix'
- 'documentation'
- 'maintenance'
default: patch
autolabeler:
- label: 'automation'
title:
- '/^(ci|perf|refactor|test).*/i'
- label: 'enhancement'
title:
- '/^(style).*/i'
- label: 'documentation'
title:
- '/^(docs).*/i'
- label: 'feature'
title:
- '/^(feat).*/i'
- label: 'breaking'
title:
- '/^(break).*/i'
- label: 'fix'
title:
- '/^(fix).*/i'
- label: 'infrastructure'
title:
- '/^(infrastructure).*/i'
- label: 'maintenance'
title:
- '/^(chore|maintenance).*/i'
- label: 'revert'
title:
- '/^(revert).*/i'
44 changes: 44 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Reference: https://github.com/amannn/action-semantic-pull-request
---
name: "PR"

on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

permissions:
contents: read

jobs:
pr_title:
permissions:
pull-requests: write
statuses: write
name: Validate & Label PR
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: |
chore
ci
docs
feat
fix
perf
refactor
revert
test
break
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Release

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: read

jobs:
create_github_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:
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_npm_release:
if: github.event.pull_request.head.repo.full_name == github.repository # Everything but this step can be tested on a fork
needs: create_github_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 }}

0 comments on commit e6eec8e

Please sign in to comment.