2022-03-09 15:06:53 +00:00
|
|
|
name: Release Start
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
channel:
|
|
|
|
required: true
|
|
|
|
type: choice
|
|
|
|
description: Channel of the release (alpha/beta/stable)
|
|
|
|
options:
|
|
|
|
- alpha
|
|
|
|
- beta
|
|
|
|
- stable
|
|
|
|
version:
|
|
|
|
required: true
|
|
|
|
description: version of the release (e.g. 2022.1.0)
|
|
|
|
iteration:
|
|
|
|
required: false
|
|
|
|
description: iteration of the release, used for non-stable releases (version-channel.iteration) (e.g. 0, 1, 2, 3 ...)
|
|
|
|
default: '0'
|
|
|
|
|
|
|
|
env:
|
|
|
|
RELEASE_VERSION: ${{ github.event.inputs.version }}${{ github.event.inputs.channel != 'stable' && format('-{0}.{1}', github.event.inputs.channel, github.event.inputs.iteration) || '' }}
|
|
|
|
RELEASE_BRANCH: release/${{ github.event.inputs.version }}${{ github.event.inputs.channel != 'stable' && format('-{0}.{1}', github.event.inputs.channel, github.event.inputs.iteration) || '' }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup-release-branch:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Create Branch # Create a branch if it doesn't exist
|
|
|
|
uses: peterjgrainger/action-create-branch@v2.0.1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
branch: ${{ env.RELEASE_BRANCH }}
|
|
|
|
|
|
|
|
- name: Checkout branch # Check out the new branch
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.RELEASE_BRANCH }}
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
|
|
|
|
- name: Configure Git user
|
|
|
|
id: configure_git_user
|
|
|
|
uses: Homebrew/actions/git-user-config@master
|
|
|
|
with:
|
|
|
|
username: ${{ (github.event_name == 'workflow_dispatch' && github.actor) || 'insomnia-infra' }}
|
|
|
|
|
|
|
|
- name: Run bootstrap
|
|
|
|
run: npm run bootstrap
|
|
|
|
|
2022-05-02 10:06:52 +00:00
|
|
|
- name: Lerna version (stable)
|
|
|
|
if: github.event.inputs.channel == 'stable'
|
2022-10-28 12:49:45 +00:00
|
|
|
run: npm run version -- --yes --no-push 'minor'
|
2022-05-02 10:06:52 +00:00
|
|
|
|
|
|
|
- name: Lerna version (alpha/beta)
|
|
|
|
if: github.event.inputs.channel != 'stable'
|
2022-10-28 12:49:45 +00:00
|
|
|
run: npm run version -- --yes --no-push --preid "${{ github.event.inputs.channel }}" "${{ github.event.inputs.iteration == '0' && 'preminor' || 'prerelease' }}"
|
2022-03-09 15:06:53 +00:00
|
|
|
|
2022-04-20 14:56:25 +00:00
|
|
|
- name: Config version
|
|
|
|
run: APP_VERSION="${{ env.RELEASE_VERSION }}" npm run app-bump-version
|
|
|
|
|
2022-04-20 15:14:33 +00:00
|
|
|
# https://github.com/lerna/lerna/issues/2832
|
|
|
|
- name: Update package-lock.json files
|
2022-04-22 11:30:11 +00:00
|
|
|
run: npx lerna clean --yes && npx lerna bootstrap --no-ci --ignore-scripts -- --package-lock-only --no-audit
|
2022-04-20 15:14:33 +00:00
|
|
|
|
2022-03-10 11:37:17 +00:00
|
|
|
- name: Commit
|
|
|
|
run: git commit -am "Bump app version to ${{ env.RELEASE_VERSION }} and lerna package versions"
|
2022-03-09 15:06:53 +00:00
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
run: |
|
|
|
|
remote_repo="https://${GITHUB_ACTOR}:${RELEASE_GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
|
|
|
git push "${remote_repo}" --follow-tags
|
|
|
|
env:
|
|
|
|
RELEASE_GH_TOKEN: ${{ secrets.RELEASE_GH_TOKEN }}
|
|
|
|
|
|
|
|
create-pull-request:
|
|
|
|
needs: setup-release-branch
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch # Check out the new branch
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ env.RELEASE_BRANCH }}
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Run the Action
|
|
|
|
uses: devops-infra/action-pull-request@v0.4.2
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.RELEASE_GH_TOKEN }}
|
|
|
|
source_branch: ${{ env.RELEASE_BRANCH}}
|
|
|
|
target_branch: develop
|
|
|
|
title: ":rocket: ${{ env.RELEASE_VERSION}}"
|
|
|
|
body: |
|
|
|
|
**Automated pull request**
|
|
|
|
Artifacts build in progress...
|
|
|
|
draft: false
|