diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58b0c7d..bfedb5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,15 @@ name: Create Release on: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ + workflow_dispatch: + inputs: + release: + description: "Create new release" + type: choice + options: + - major + - minor + - patch jobs: build: @@ -13,6 +19,16 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Update app version + run: | + npm version ${{ inputs.release }} + git push --follow-tags + - name: Update CHANGELOG id: changelog uses: requarks/changelog-action@v1 @@ -33,6 +49,14 @@ jobs: - name: Commit CHANGELOG.md uses: stefanzweifel/git-auto-commit-action@v4 with: - branch: main + branch: develop commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }}" 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 }}