-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (35 loc) · 1.22 KB
/
release_hotfix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 }}"
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 }}