forked from abapGit/abapGit
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (104 loc) · 3.17 KB
/
main-build.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: main-build
on:
push:
branches:
- main
jobs:
build-merged:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Run npm steps
run: |
npm install
npm run merge
npm run merge.ci
- name: build-merged-build
run: ./ci/build-merged-build.sh
- name: deploy-merged-build
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && github.repository == 'abapGit/abapGit'
with:
deploy_key: ${{ secrets.DEPLOY_ABAPGIT_BUILD }}
external_repository: abapGit/build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
publish_branch: main
publish_dir: ../build
- name: Upload build artifact
if: always()
uses: actions/upload-artifact@main
with:
name: zabapgit_standalone.abap
path: ./zabapgit.abap
retention-days: 7
auto-tag:
runs-on: ubuntu-latest
outputs:
pushedTag: ${{ steps.deploy-release-tag.outputs.pushedTag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: deploy-release-tag
id: deploy-release-tag
if: github.ref == 'refs/heads/main' && github.repository == 'abapGit/abapGit'
env:
GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
GIT_USER_NAME: 'github-actions[bot]'
GIT_USER_EMAIL: 'github-actions[bot]@users.noreply.github.com'
run: ./ci/deploy-release-tag.sh
auto-tag-artifact:
runs-on: ubuntu-latest
needs: [build-merged, auto-tag]
if: github.ref == 'refs/heads/main' && github.repository == 'abapGit/abapGit' && !!needs.auto-tag.outputs.pushedTag
steps:
- uses: actions/checkout@v3
with:
repository: abapGit/build
path: build
ssh-key: ${{ secrets.DEPLOY_ABAPGIT_BUILD }}
- uses: actions/checkout@v3
with:
path: abapGit
- name: mirror tag to the artifact
env:
GIT_USER_NAME: 'github-actions[bot]'
GIT_USER_EMAIL: 'github-actions[bot]@users.noreply.github.com'
run: |
cd build
../abapGit/ci/push-tag.sh ${{ needs.auto-tag.outputs.pushedTag }}
coverage:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: npm run unit
run: |
npm install
npm run unit
- name: npm run coverage
run: |
npm run coverage
- name: Update coverage.abapgit.org
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' && github.repository == 'abapGit/abapGit'
with:
deploy_key: ${{ secrets.COVERAGE_DEPLOY_KEY }}
external_repository: abapGit/coverage.abapgit.org
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
publish_branch: main
cname: coverage.abapgit.org
force_orphan: true
publish_dir: ./coverage