1+ name : version-increment
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ secrets-gate :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ ok : ${{ steps.check-secrets.outputs.ok }}
12+ steps :
13+ - name : check for secrets needed to run workflows
14+ id : check-secrets
15+ run : |
16+ if [ ${{ secrets.PROJECT_VERSION_INCREMENT_ENABLED }} == 'true' ]; then
17+ echo "ok=enabled" >> $GITHUB_OUTPUT
18+ fi
19+ publish-npm :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v3
23+ - uses : actions/setup-node@v3
24+ with :
25+ node-version : 22.x
26+ scope : ' @ir-engine'
27+ - name : Set git username
28+ run : git config user.name "CI Bot"
29+ - name : Set git email
30+ run : git config user.email ci-bot@ir-engine.org
31+ - name : Set pr_branch_name environment variable
32+ run : echo pr_branch_name=version-increment-${{ github.event.release.tag_name }} >> $GITHUB_ENV
33+ - name : Switch to branch ${{ env.pr_branch_name }}
34+ run : git switch -c ${{ env.pr_branch_name }}
35+ - name : NPM increment version
36+ run : npm version ${{ github.event.release.tag_name }} --no-git-tag-version
37+ env :
38+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
39+ NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
40+ - name : Move root package.json
41+ run : mv package.json package.json.altered
42+ - name : Install dependencies for running bump-project-versions
43+ run : npm install cross-env@7.0.3 ts-node@10.9.2 cli@1.0.1 app-root-path@3.0.0
44+ - name : Move root package.json back
45+ run : mv package.json.altered package.json
46+ - name : Bump default and template project version
47+ run : node scripts/bump-project-versions.js
48+ - name : Run git add
49+ run : git add .
50+ - name : Commit changes
51+ run : git commit -m ${{ github.event.release.tag_name }}
52+ - name : Push changes to new branch
53+ run : git push --no-verify origin ${{ env.pr_branch_name }}
54+ - name : Create version bump PR
55+ uses : repo-sync/pull-request@v2
56+ with :
57+ destination_branch : ${{ github.event.release.target_commitish }}
58+ github_token : ${{ secrets.GITHUB_TOKEN }}
59+ source_branch : ${{ env.pr_branch_name }}
60+ pr_title : ${{ github.event.release.tag_name }}
61+ pr_body : Bump version to ${{ github.event.release.tag_name }}
0 commit comments