hot fix test #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- 'release-**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
name: Publish Platform Hotfix | |
permissions: | |
contents: write | |
jobs: | |
build: | |
if: "!contains(github.event.commits[0].message, '[hotfix]') && !contains(github.event.commits[0].message, '[release]')" | |
name: datalens-us | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: . | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: 'Get current release' | |
run: | | |
COMMIT_NAME=$(git log -n 1 --pretty=format:%s) | |
RELEASE_BRANCH="$GITHUB_REF_NAME" | |
RELEASE_VERSION=$(echo $RELEASE_BRANCH | sed 's|release-||') | |
echo "Release version: ${RELEASE_VERSION}" | |
echo "COMMIT_NAME=$COMMIT_NAME" >> "$GITHUB_ENV" | |
- name: 'Make new release version number' | |
run: | | |
TAG_NEW_VERSION=$(npm version patch --no-git-tag-version --allow-same-version) | |
NEW_VERSION=$(echo $TAG_NEW_VERSION | sed 's|v||') | |
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_ENV" | |
echo "TAG_NEW_VERSION=$TAG_NEW_VERSION" >> "$GITHUB_ENV" | |
- name: 'Commit package version' | |
run: | | |
git config user.email "" && git config user.name "GitHub Release" | |
git add package.json && git add package-lock.json && git commit -am "Bump version to $NEW_VERSION [hotfix]" | |
git push | |
- uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.TAG_NEW_VERSION }} | |
release_name: ${{ env.TAG_NEW_VERSION }} | |
commitish: ${{ env.GITHUB_REF_NAME }} | |
body: ${{ env.COMMIT_NAME }} | |
draft: false | |
prerelease: false | |
- name: 'Success notify' | |
run: echo "Version bumped to '$TAG_NEW_VERSION' and pushed to remote repository" |