Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add manual workflow for release #1384

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create release

on:
workflow_dispatch:
inputs:
mode:
type: choice
description: release type
required: true
default: 'minor'
options:
- patch
- minor
- major

jobs:
run-release:
name: Run release
runs-on: ubuntu-latest
vladimirpotekhin marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Fetch from origin repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.TINKOFF_BOT_PAT }}

- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs

- name: Run release
id: run-release
run: |
git config user.name "tinkoff-bot"
git config --global push.followTags true
npm run release -- --release-as ${{ github.event.inputs.mode }}
npm run prettier
git add .
git commit -m 'chore: run prettier' --no-verify
echo "::set-output name=new_version::$(node -p "require('./package.json').version")"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.TINKOFF_BOT_PAT }}
branch: release/${{ steps.run-release.outputs.new_version }}
title: 'Release/${{ steps.run-release.outputs.new_version }}'

concurrency:
group: create-release-${{ github.head_ref }}
cancel-in-progress: true
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Release Taiga UI packages

on:
push:
pull_request:
types: [labeled]
branches:
- 'release/**'

Expand All @@ -12,6 +13,7 @@ env:

jobs:
build:
if: ${{ github.event.label.name == 'ready to merge' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ execSync(`git checkout -b release/${newVersion}`, options);
execSync(`npm run release -- --release-as ${mode}`, options);

execSync(`npm run prettier`, options);
execSync(`git add . && git commit --all --amend --no-edit --no-verify`, options);
execSync(`git commit -m 'chore: run prettier' --no-verify`);

checkChangelog().then(() => {
execSync(`git add . && git commit --all --amend --no-edit --no-verify`, options);
execSync(
`git commit -m 'chore(changelog): fix incorrect generated logs' --no-verify`,
);
execSync(`git push --set-upstream origin release/${newVersion}`, options);
execSync(`git push --tags`, options);
});
Expand Down