-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (59 loc) · 2.31 KB
/
version-increment.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
name: version-increment
on:
release:
types: [created]
jobs:
secrets-gate:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check-secrets.outputs.ok }}
steps:
- name: check for secrets needed to run workflows
id: check-secrets
run: |
if [ ${{ secrets.PROJECT_VERSION_INCREMENT_ENABLED }} == 'true' ]; then
echo "ok=enabled" >> $GITHUB_OUTPUT
fi
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 22.x
scope: '@ir-engine'
- name: Set git username
run: git config user.name "CI Bot"
- name: Set git email
run: git config user.email [email protected]
- name: Set pr_branch_name environment variable
run: echo pr_branch_name=version-increment-${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Switch to branch ${{ env.pr_branch_name }}
run: git switch -c ${{ env.pr_branch_name }}
- name: NPM increment version
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Move root package.json
run: mv package.json package.json.altered
- name: Install dependencies for running bump-project-versions
- name: Move root package.json back
run: mv package.json.altered package.json
- name: Bump default and template project version
run: node scripts/bump-project-versions.js
- name: Run git add
run: git add .
- name: Commit changes
run: git commit -m ${{ github.event.release.tag_name }}
- name: Push changes to new branch
run: git push --no-verify origin ${{ env.pr_branch_name }}
- name: Create version bump PR
uses: repo-sync/pull-request@v2
with:
destination_branch: ${{ github.event.release.target_commitish }}
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.pr_branch_name }}
pr_title: ${{ github.event.release.tag_name }}
pr_body: Bump version to ${{ github.event.release.tag_name }}