forked from googleapis/release-please
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.48 KB
/
release.yaml
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: Create GitHub releases
on:
pull_request:
types:
- closed
- labeled
jobs:
create-releases:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout release branch
run: |
git config --global user.name "Stainless Bot"
git config --global user.email "stainless-bot@users.noreply.github.com"
git checkout release
- name: Merge main into release branch
run: |
git pull origin release --rebase=false --ff-only
git merge --no-ff main
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Lint code
run: npm run lint
- name: Run tests
run: npm run test
- name: Compile
run: npm run compile
- name: Commit and push build directory
run: |
git add -f ./build
git diff --cached --exit-code || git commit -m "Build sources"
git push origin release
- name: Create github release
run: |
npm run cli -- github-release \
--token=${{ secrets.GITHUB_TOKEN }} \
--repo-url=${{ github.repository }} \
--target-branch=release