bazarr/.github/workflows/release_major_and_merge.yaml

59 lines
1.7 KiB
YAML

name: release_major_and_merge
on:
workflow_dispatch
jobs:
Release:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- name: Validate branch
if: ${{ github.ref != 'refs/heads/development' }}
run: |
echo This action can only be run on development branch, not ${{ github.ref }}
exit 1
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: development
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: '15.x'
- run: npm install -D release-it
- run: npm install -D @release-it/bumper
- run: npm install -D auto-changelog
- id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Define LAST_VERSION environment variable
run: |
echo "LAST_VERSION=${{steps.latest_release.outputs.release}}" >> $GITHUB_ENV
- name: Update version and create release
uses: TheRealWaldo/release-it@v0.2.1
with:
json-opts: '{"increment": "major"}'
Merge:
needs: Release
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Merge development -> master
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: development
target_branch: master
github_token: ${{ secrets.GITHUB_TOKEN }}