Skip to content

Commit 5c89058

Browse files
committed
feat: use reusable workflow for release builder
1 parent a2a9440 commit 5c89058

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,23 @@
11
on:
2+
# Any pull request merged into master (hotfixes, releases)
3+
# should publish the corresponding github release + git tag
24
push:
3-
tags: # triggered once a git tag is published
4-
- '*'
5+
branches:
6+
- main
7+
- master
8+
9+
workflow_dispatch: # build a new release manually (create release branch pointing to master branch)
10+
inputs:
11+
version_name:
12+
# Edit release_builder.json#base_branches to support other branches
13+
description: 'Release version name, sample: 1.0.0 (Only "develop" branch is supported)'
14+
required: true
515

616
name: Create Release
717

818
jobs:
9-
build:
10-
name: Create Release
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v2
15-
with:
16-
fetch-depth: 0
17-
18-
# Changelog action adaptations
19-
- name: Create required package.json
20-
run: test -f package.json || echo '{}' >package.json
21-
- name: Detect Previous Tag (action not detecting very well)
22-
run: echo "::set-output name=previous_tag::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
23-
id: tag_checker
24-
25-
- name: Generate Changelog
26-
uses: scottbrenner/generate-changelog-action@master
27-
id: Changelog
28-
with:
29-
from-tag: ${{steps.tag_checker.outputs.previous_tag}}
30-
to-tag: HEAD
31-
32-
- name: Create Release
33-
id: create_release
34-
uses: actions/create-release@latest
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
37-
with:
38-
tag_name: ${{ github.ref }}
39-
release_name: Release ${{ github.ref }}
40-
body: |
41-
${{ steps.Changelog.outputs.changelog }}
42-
draft: false
43-
prerelease: false
19+
release-builder:
20+
uses: owen2345/reusable-ci-cd-actions/.github/workflows/release_builder.yml@main
21+
with:
22+
commit_mode: true
23+
create_release_pr: ${{ github.event.inputs && github.event.inputs.version_name || '' }}

0 commit comments

Comments
 (0)