Create Release #40
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
name: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: "Create new release" | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: Configure committer | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: Update app version | |
run: | | |
npm version ${{ inputs.release }} | |
- name: get-npm-version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Push tag version | |
run: | | |
git push origin v${{ steps.package-version.outputs.current-version }} | |
- name: Update CHANGELOG | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
tag: v${{ steps.package-version.outputs.current-version }} | |
- name: Create Release | |
uses: ncipollo/release-action@v1.12.0 | |
with: | |
allowUpdates: true | |
draft: false | |
makeLatest: true | |
name: v${{ steps.package-version.outputs.current-version }} | |
tag: v${{ steps.package-version.outputs.current-version }} | |
body: ${{ steps.changelog.outputs.changes }} | |
token: ${{ github.token }} | |
- name: Commit CHANGELOG.md | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: develop | |
commit_message: "docs: update CHANGELOG.md for v${{ steps.package-version.outputs.current-version }}" | |
file_pattern: CHANGELOG.md | |
- name: Merge develop in main | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
from_branch: develop | |
target_branch: main | |
github_token: ${{ secrets.GITHUB_TOKEN }} |