-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (116 loc) · 3.64 KB
/
nodejs_merge.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
pull_request:
branches:
- next
- latest
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run lint
merge:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: automerge
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
MERGE_LABELS: ""
test:
needs: merge
runs-on: ubuntu-latest
steps:
- id: tagger
uses: phish108/[email protected]
with:
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
dry-run: 'TRUE'
branch: next
- name: Autotag Draft
uses: phish108/autotag-action@master
id: taggerTest
with:
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
branch: next
dry-run: 'true'
- name: verify Tags
run: |
if [ "${{ steps.tagger.outputs.new-tag }}" != "${{ steps.taggerTest.outputs.new-tag }}" ]
then
exit 1
fi
verify:
needs: test
runs-on: ubuntu-latest
steps:
- name: check changes
id: release
uses: phish108/[email protected]
- name: only dev changes (from PR)
run: exit 1
if: ${{ steps.release.outputs.hold_development == 'true' }}
- name: only protected changes (from other non-main branch)
run: exit 1
if: ${{ steps.release.outputs.hold_protected == 'true' }}
- name: Proceed to release
run: echo OK
build:
needs: verify
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 16.x
- 18.x
steps:
- uses: actions/checkout@v3
with:
ref: master
- run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: check changes
id: release
uses: phish108/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- id: tagger
if: ${{ steps.release.outputs.proceed == 'true' }}
uses: phish108/[email protected]
with:
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
branch: next
dry-run: 'TRUE'
- if: ${{ steps.release.outputs.proceed == 'true' }}
run: |
echo "${{ steps.tagger.outputs.new-tag }}"
npm ci
npm run package
npm --no-git-tag-version --allow-same-version version ${{ steps.tagger.outputs.new-tag }}
sed -ri "s/pypestream\/auto-release@[0-9]*\.[0-9]*\.[0-9]*/pypestream\/auto-release@${{ steps.tagger.outputs.new-tag }}/g" README.md
git commit -m "updated dist file for $GITSHA" -a
env:
GITSHA: ${{ github.sha }}
# very risky ... because of using the master branch
- name: Push changes
if: ${{ steps.release.outputs.proceed == 'true' }}
uses: ad-m/github-push-action@master
with:
GITHUB_TOKEN${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- uses: phish108/[email protected]
if: ${{ steps.release.outputs.proceed == 'true' }}
with:
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
branch: next