66 - main
77
88jobs :
9- version :
10- name : Version & Build
9+ validate :
10+ name : Validate Package
1111 runs-on : macos-latest
12- environment : release
13- permissions :
14- contents : write
15-
16- outputs :
17- version : ${{ steps.get_new_version.outputs.result}}
1812
1913 steps :
2014 - name : Checkout code
2115 uses : actions/checkout@v4
22- with :
23- token : ${{secrets.ELEVATED_TOKEN}}
24-
25- - name : 📇 Configure git
26- run : |
27- git fetch --prune --unshallow
28- git config --global user.name "GitHub Actions"
29- git config --global user.email "gh-actions@merckgroup.com"
30- shell : bash
31-
32- # Retrieve the new version
33- - name : 🔂 Run standard-version
34- uses : actions/github-script@v7
35- with :
36- script : |
37- const {execSync} = require('child_process');
38- execSync('npx standard-version --skip.tag', {stdio: 'inherit'});
39-
40- # Retrieve the new version
41- - name : ⏎ Get new version
42- uses : actions/github-script@v7
43- id : get_new_version
44- with :
45- result-encoding : string
46- script : |
47- const fs = require('fs');
48- const package = JSON.parse(fs.readFileSync('package.json', 'utf8'));
49- return package.version;
50-
51- - name : Print new version
52- run : echo ${{ steps.get_new_version.outputs.result}}
53-
54- # Bump the pubspec.yaml file
55- - name : ⬆️ Bump pubspec.yaml
56- uses : emdgroup/mtrust-urp/.github/shared_actions/update-pubspec@main
57- with :
58- version : ${{ steps.get_new_version.outputs.result }}
59- directory : .
60-
61- - name : 📝 Update version in readme
62- uses : emdgroup/mtrust-urp/.github/shared_actions/update-pubspec-readme-version@main
63- with :
64- directory : .
6516
6617 - name : Setup Dart
6718 uses : dart-lang/setup-dart@v1
@@ -82,24 +33,17 @@ jobs:
8233 with :
8334 directory : " ."
8435
85- # We first commit with proper message and add an empty commit to keep the files history clean
86- - name : Update repo versions
87- run : |
88- git add .
89- git commit -m "chore(release): ${{ steps.get_new_version.outputs.result }}"
90- git commit --allow-empty -m "chore(release): ${{ steps.get_new_version.outputs.result }} [skip ci]"
91- git push origin main
92-
93- # For this part it is important to not push a commit with [skip ci] before the tag release
94- - name : Push tag for pub.dev
95- run : |
96- git commit --allow-empty -m "chore(release): ${{ steps.get_new_version.outputs.result }}"
97- git tag -a v${{ steps.get_new_version.outputs.result }} -m "Pub.dev version ${{ steps.get_new_version.outputs.result }}"
98- git push origin v${{ steps.get_new_version.outputs.result }}
36+ api-guard :
37+ needs : validate
38+ uses : emdgroup/mtrust-api-guard/.github/workflows/publish_workflow.yaml@main
39+ with :
40+ git_push_branch : main
41+ git_push : true
42+ secrets : inherit
9943
10044 rebase_dev :
10145 name : Write changes to dev branch
102- needs : [version ]
46+ needs : [api-guard ]
10347 runs-on : ubuntu-latest
10448 permissions :
10549 contents : write
0 commit comments