-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (44 loc) · 1.35 KB
/
release.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
name: Draft release
run-name: Draft release ${{ inputs.next_version }}
on:
workflow_dispatch:
inputs:
next_version:
required: true
type: string
description: 'Version name'
permissions:
contents: write
jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Branch change and package version update
run: |
git config --local user.email "github-actions@github.com"
git config --local user.name "GitHub Actions"
git checkout develop
npm version --no-git-tag-version --no-commit-hooks ${{ inputs.next_version }}
- name: Modify algoliaconfig file
run: |
sed -i 's/"version": ".*"/"version": "${{ inputs.next_version }}"/' version.json
- name: Commit changes
run: |
git add .
git commit -m "Update version to ${{ inputs.next_version }}"
git push
- name: Merge develop into master
run: |
git checkout master
git pull
git merge origin/develop
git push
- name: Draft release
run: gh release create $VERSION --generate-notes --draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ inputs.next_version }}