Skip to content

chore: add git diff before publish to avoid some issues with it #126

Merged
merged 1 commit into from
Aug 3, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
name: releaseon: push: branches: - masterenv: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}jobs: release: if: "!contains(github.event.head_commit.message, 'chore(release)')" runs-on: ubuntu-latest steps: - name: Initialize Git user run: | git config --global user.name 'tinkoff-bot' git config --global user.email '[email protected]' - uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.TINKOFF_BOT_PAT }} - uses: actions/setup-node@v3 with: node-version: 18.x registry-url: 'https://registry.npmjs.org' - name: Install dependencies run: yarn bootstrap - name: Release packages run: yarn release env: GH_TOKEN: ${{ secrets.TINKOFF_BOT_PAT }} - name: Publish docs run: yarn docs:publish env: GIT_USER: ${{ secrets.TINKOFF_BOT_PAT }}
name: release

on:
push:
branches:
- master

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
release:
if: "!contains(github.event.head_commit.message, 'chore(release)')"

runs-on: ubuntu-latest

steps:
- name: Initialize Git user
run: |
git config --global user.name 'tinkoff-bot'
git config --global user.email '[email protected]'

- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.TINKOFF_BOT_PAT }}

- uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn bootstrap

- name: Build packages
run: |
yarn build
git diff --exit-code || (echo "Найдены изменения в файлах package.json – выполните `yarn build` в корне репозитория и запушьте изменения" && exit 127)

- name: Release packages
run: yarn release
env:
GH_TOKEN: ${{ secrets.TINKOFF_BOT_PAT }}

- name: Publish docs
run: yarn docs:publish
env:
GIT_USER: ${{ secrets.TINKOFF_BOT_PAT }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"bootstrap": "yarn --frozen-lockfile",
"build": "lerna run prepack",
"watch": "lerna run watch --parallel",
"release": "lerna publish --no-private --conventional-commits --yes --create-release github",
"release": "lerna publish --no-private --conventional-commits --ignore-scripts --yes --create-release github",
"clean": "git clean -Xdf .",
"docs:build": "yarn --cwd ./website build",
"docs:start": "yarn --cwd ./website start",
Expand Down
Loading