Skip to content

Release hotfix from master #1

Release hotfix from master

Release hotfix from master #1

name: Release hotfix from master
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
token: ${{ secrets.SRE_GHACTIONS_TOKEN }}
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: patch
- name: Release Package
shell: bash
env:
GIT_AUTH_TOKEN: ${{ secrets.SRE_GHACTIONS_TOKEN }}
run: |
git config user.name "ami-ci"
git config user.email "<>"
# Update the package.json version. Skip the git tag, we'll do that later
npm version ${{ steps.bump-semver.outputs.new_version }} --no-git-tag-version
# Commit the changed package.json file to master
git add package.json
git commit -m "Bump version to ${{ steps.bump-semver.outputs.new_version }} [skip ci]"
git push origin master
# Tag the new version
git tag ${{ steps.bump-semver.outputs.new_version }}
git push origin ${{ steps.bump-semver.outputs.new_version }}