Merge pull request #7965 from weseek/support/reorganize-global-naviga… #1918
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: Draft Release | |
on: | |
push: | |
branches: | |
- master | |
- dev/*.*.* | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Refs: https://github.com/release-drafter/release-drafter | |
update-release-draft: | |
runs-on: ubuntu-latest | |
outputs: | |
CURRENT_VERSION: ${{ steps.package-json.outputs.packageVersion }} | |
RELEASE_DRAFT_BODY: ${{ steps.release-drafter.outputs.body }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve information from package.json | |
uses: myrotvorets/[email protected] | |
id: package-json | |
- name: Determine config file | |
id: determine-config-name | |
run: | | |
BRANCH_NAME="${{ github.ref_name }}" | |
BRANCH_NAME_REPLACED=${BRANCH_NAME/\//-} | |
echo "value=release-drafter-$BRANCH_NAME_REPLACED.yml" >> $GITHUB_OUTPUT | |
- uses: release-drafter/release-drafter@v5 | |
id: release-drafter | |
with: | |
config-name: ${{ steps.determine-config-name.outputs.value }} | |
name: v${{ steps.package-json.outputs.packageVersion }} | |
tag: v${{ steps.package-json.outputs.packageVersion }} | |
version: ${{ steps.package-json.outputs.packageVersion }} | |
disable-autolabeler: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Refs: https://github.com/bakunyo/git-pr-release-action | |
update-release-pr: | |
needs: update-release-draft | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get release version | |
id: release-version | |
run: | | |
RELEASE_VERSION=`npx semver -i patch ${{ needs.update-release-draft.outputs.CURRENT_VERSION }}` | |
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT | |
- name: Create/Update Pull Request | |
uses: bakunyo/git-pr-release-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_PR_RELEASE_BRANCH_PRODUCTION: release/current | |
GIT_PR_RELEASE_BRANCH_STAGING: ${{ github.ref_name }} | |
GIT_PR_RELEASE_TEMPLATE: .github/git-pr-release-template.erb | |
GIT_PR_RELEASE_TITLE: Release v${{ steps.release-version.outputs.RELEASE_VERSION }} | |
GIT_PR_RELEASE_BODY: ${{ needs.update-release-draft.outputs.RELEASE_DRAFT_BODY }} | |