-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add github actions for release process (#12)
- Loading branch information
Showing
4 changed files
with
101 additions
and
0 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,23 @@ | ||
name-template: '$RESOLVED_VERSION' | ||
tag-template: '$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feat' | ||
- 'feature' | ||
- 'doc' | ||
- 'enhancement' | ||
- 'test' | ||
- 'refactor' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
labels: | ||
- 'chore' | ||
- 'ci' | ||
change-template: '- $TITLE (#$NUMBER) @$AUTHOR' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
template: | | ||
$CHANGES |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- develop | ||
- main | ||
pull_request: | ||
jobs: | ||
lint: | ||
|
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,37 @@ | ||
name: "Draft new release" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version to release' | ||
required: true | ||
|
||
jobs: | ||
draft-new-release: | ||
name: "Draft new release" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Validate the version | ||
uses: actions-ecosystem/action-regex-match@v2 | ||
with: | ||
text: ${{ github.event.inputs.version }} | ||
regex: '^v\d+(\.\d+){2}$' | ||
|
||
- name: Create release branch | ||
run: git checkout -b release/${{ github.event.inputs.version }} | ||
|
||
- name: Push new branch | ||
run: git push origin release/${{ github.event.inputs.version }} | ||
|
||
- name: Create pull request | ||
uses: thomaseizinger/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
head: release/${{ github.event.inputs.version }} | ||
base: main | ||
title: Release version ${{ github.event.inputs.version }} | ||
reviewers: ${{ github.actor }} |
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,40 @@ | ||
name: "Publish new release" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
release: | ||
name: Publish new release | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event.pull_request.merged == true | ||
|
||
steps: | ||
- name: Extract version from branch name | ||
if: startsWith(github.event.pull_request.head.ref, 'release/') | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
VERSION=${BRANCH_NAME#release/} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Validate the version | ||
uses: actions-ecosystem/action-regex-match@v2 | ||
with: | ||
text: ${{ env.RELEASE_VERSION }} | ||
regex: '^v\d+(\.\d+){2}$' | ||
|
||
- name: Create Release | ||
id: generate_changelog | ||
uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
version: ${{ env.RELEASE_VERSION }} | ||
tag: ${{ env.RELEASE_VERSION }} | ||
name: Release ${{ env.RELEASE_VERSION }} | ||
publish: false |