-
Notifications
You must be signed in to change notification settings - Fork 44
36 lines (34 loc) · 1.19 KB
/
semantic-release.yml
File metadata and controls
36 lines (34 loc) · 1.19 KB
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
name: Semantic release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
private-key: ${{ secrets.SEMANTIC_RELEASE_PK }}
- uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
- name: increment version, commit, push
run: |
DOC_FILE="docs/v3/openapi.json docs/admin/openapi.json"
CLOWDER_FILE=deploy/clowdapp.yaml
VERSION=$(cat VERSION)
[ "$(git log -1 --pretty=%B)" == "$VERSION" ] && exit 0
RELEASE_TYPE=$(git log -1 | tail -n1) # Check release type (/major, /minor, /patch (default))
VERSION_NEXT=$(./scripts/increment_version.sh $VERSION $RELEASE_TYPE)
sed -i 's|\("version": "\)[^"]*\("\)$|'"\1$VERSION_NEXT\2|;" $DOC_FILE
echo $VERSION_NEXT >VERSION
git config --global user.name 'semantic-release'
git config --global user.email ''
git commit -am "${VERSION_NEXT}"
git push
git tag ${VERSION_NEXT}
git push origin ${VERSION_NEXT}