-
Notifications
You must be signed in to change notification settings - Fork 8
56 lines (50 loc) · 2.09 KB
/
bump-gitstream-core.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
# install new gitstream-core version and open PR with new changes
name: Bump gitstream-core
run-name: Bump gitstream-core to `${{ inputs.version }}`
on:
workflow_dispatch:
inputs:
version:
description: Version number (ex. "2.1.20")
required: true
default: 2.1.20
ticket:
description: LINBEE-XXXX ticket number
default: LINBEE-8514
required: false
descritpion:
description: Add description for this version
required: false
jobs:
publish_pr:
name: Publish PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version to ENV
run: |
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
echo "BRANCH_NAME=${{ inputs.version }}-bump-gitstream-core-to-${{ inputs.version }}" >> "$GITHUB_ENV"
- name: Init npmrc
run: |
curl -H "X-JFrog-Art-API: ${{ secrets.ARTIFACTORY_API_KEY }}" https://linearb.jfrog.io/linearb/api/npm/npm-local/auth/linearb >> .npmrc
- name: Install @linearb/gitstream-core@${{ env.VERSION }}
run: npm install --save --save-exact @linearb/gitstream-core@${{ env.VERSION }}
- name: Run Format & Lint & Test & Build & Package
run: npm run all
- name: Create PR for ${{ env.VERSION }}
env:
GH_TOKEN: ${{ github.token }}
run: |
echo -e "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`\n\n${{ inputs.descritpion }}" > pr_description.txt
git config --global user.name 'GitHub Actions Bot'
git config --global user.email 'actions@github.com'
git add package.json package-lock.json dist/index.js
git commit -m "bump `@linearb/gitstream-core` to `${{ env.VERSION }}\n${{ inputs.descritpion }}`"
git push origin HEAD:${{ env.BRANCH_NAME }}
gh pr create \
--base v2-develop \
--title "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`" \
--body-file pr_description.txt \
--head ${{ env.BRANCH_NAME }} \
--reviewer ${{ github.actor }}