Skip to content

chore(release): pulling release/1.25.1 into master #57

chore(release): pulling release/1.25.1 into master

chore(release): pulling release/1.25.1 into master #57

name: Publish new github release
on:
workflow_dispatch:
pull_request:
branches: [ 'master', 'master-mpx' ]
types:
- closed
jobs:
release:
name: Publish new release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/master') || ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'release-mpx/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release-mpx/')) && github.event.pull_request.merged == true) # only merged pull requests must trigger this job
steps:
- name: Extract version from branch name (for release branches)
id: extract-version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix-}
VERSION=${VERSION#release-mpx/}
VERSION=${VERSION#release/}
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Create Github Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.AUTH_GITHUB_TOKEN }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.PAT }}
run: |
npx conventional-github-releaser -p angular
- name: Create pull request into develop
uses: repo-sync/pull-request@v2
if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/'))
with:
source_branch: 'master'
destination_branch: 'develop'
github_token: ${{ secrets.PAT }}
pr_title: "chore(release): pulling main into develop post release v${{ steps.extract-version.outputs.release_version }}"
pr_body: ':crown: *An automated PR*'
pr_reviewer: '@rudderlabs/sdk-android'
- name: Create pull request into develop-mpx
uses: repo-sync/pull-request@v2
if: (startsWith(github.event.pull_request.head.ref, 'release-mpx/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release-mpx/'))
with:
source_branch: 'master'
destination_branch: 'develop'
github_token: ${{ secrets.PAT }}
pr_title: "chore(release): pulling main into develop post release v${{ steps.extract-version.outputs.release_version }}"
pr_body: ':crown: *An automated PR*'
pr_reviewer: '@rudderlabs/sdk-android'
- name: Delete hotfix release branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'hotfix-release/')
with:
branches: 'hotfix-release/*'
env:
GITHUB_TOKEN: ${{ secrets.AUTH_GITHUB_TOKEN }}
- name: Delete release branch
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'release/')
with:
branches: 'release/*'
env:
GITHUB_TOKEN: ${{ secrets.AUTH_GITHUB_TOKEN }}
- name: Delete hotfix release branch -mpx
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'hotfix-release-mpx/')
with:
branches: 'hotfix-release/*'
env:
GITHUB_TOKEN: ${{ secrets.AUTH_GITHUB_TOKEN }}
- name: Delete release branch -mpx
uses: koj-co/delete-merged-action@master
if: startsWith(github.event.pull_request.head.ref, 'release-mpx/')
with:
branches: 'release/*'
env:
GITHUB_TOKEN: ${{ secrets.AUTH_GITHUB_TOKEN }}