forked from yalesites-org/yalesites-project
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.61 KB
/
release_pr.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
name: Create/update release pull request
on:
pull_request:
branches:
- master
workflow_dispatch:
env:
YALESITES_BUILD_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
ACCESS_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
jobs:
get_next_release_version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Git setup
run: |
git config user.name github-actions
git config user.email [email protected]
git branch develop origin/develop
git merge develop --no-edit -X theirs
git status
- name: Get next release number
run: |
git status
npm install --force
npx --no-install semantic-release --no-ci --dry-run
next_version=$(npx --no-install semantic-release --no-ci --dry-run 2>/dev/null | sed -nE 's/.*the next release version is ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
echo release_branch="rel-${next_version//.}" >> "$GITHUB_ENV"
- name: Create release branch
run: |
git checkout -b "$release_branch"
git push origin "$release_branch"
# create_pull_request:
# if: github.head_ref == 'develop' ||
# github.event_name == 'workflow_dispatch'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Create pull request
# run: ./.ci/github/create_release_pull_request