-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.97 KB
/
make_release.yml
File metadata and controls
59 lines (49 loc) · 1.97 KB
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
name: "Begin new release"
run-name: "Create a new release branch forking develop"
on:
workflow_dispatch:
permissions:
contents: read # for checkout
jobs:
begin_release:
name: "Begin next release"
if: ${{ github.ref_name == 'develop' && github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: debug
run: printenv; git remote -v; git status;
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/exec @saithodev/semantic-release-backmerge
- name: Setup git
run: |
git config user.email "${{ env.GITHUB_TRIGGERING_ACTOR }}"
git config user.name "github-ci-bot"
- name: Create the release branch
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
run: |
git pull
semantic-release --dry-run --no-ci
NEXT_VERSION=$(grep -Po 'Version:([ ]*)?(.*)' "style.css" | tr -s ' ' | cut -d' ' -f2)
git checkout -b "release-${NEXT_VERSION}"
sed -i "s/Version: .*/Version: release-${NEXT_VERSION}/" style.css
git add style.css
NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;)
if [[ $NEED_COMMIT == 1 ]]
then
git commit -m "ci(develop): preparing release branch release-${NEXT_VERSION}"
fi
git push origin release-${NEXT_VERSION}