-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (58 loc) · 2.26 KB
/
release.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Release
run-name: Release ${{inputs.release}} by @${{github.actor}}
on:
workflow_dispatch:
inputs:
releases:
type: choice
description: Choose the release type to do (Following SemVer)
options: [ patch, minor, major ]
jobs:
release:
permissions:
contents: write
name: Release pipeline
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Update version
id: newversion
run: |
npm version ${{github.event.inputs.releases}} --git-tag-version false
VERSION=$(cat ./package.json | jq '.version' | tr -d '"')
sed -i "s/version:.*/version: $VERSION/" openapi/openapi.yaml
echo "release-tag=$VERSION" >> $GITHUB_OUTPUT
- name: Build
run: |
npm ci
npm run package
- name: Push tag and commit release
run: |
git config --global user.email "bonita-ci@bonitasoft.com"
git config --global user.name "Bonita CI"
git add package.json package-lock.json openapi/openapi.yaml
git commit -m "Release ${{ steps.newversion.outputs.release-tag }}"
git tag ${{ steps.newversion.outputs.release-tag }}
git push origin ${{github.ref}} ${{ steps.newversion.outputs.release-tag }}
- name: Prepare artifacts to release
run: |
mv dist/openapi.yaml dist/bonita-openapi-${{ steps.newversion.outputs.release-tag }}.yaml
mv dist/postman.json dist/bonita-postman-collection-${{ steps.newversion.outputs.release-tag }}.json
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.newversion.outputs.release-tag }}
name: Release ${{ steps.newversion.outputs.release-tag }}
artifacts: dist/*
- name: Open Bonita Java Client PR
id: open_client_pr
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.BONITA_CI_PAT }}
repository: bonitasoft/bonita-java-client
event-type: new-bonita-openapi-spec-release
client-payload: '{"spec_version": "${{steps.newversion.outputs.release-tag}}"}'