-
Notifications
You must be signed in to change notification settings - Fork 7
76 lines (74 loc) · 2.33 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: api-standards-release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node.js 16
uses: actions/setup-node@v3
with:
cache: npm
node-version: 16
cache-dependency-path: rulesets/package-lock.json
- run: |
npm install
working-directory: rulesets
name: install dependencies
- run: |
npm test
working-directory: rulesets
name: unit test validation
- run: |
rm sps-api-standards.spectral.yml
name: remove existing merged rulesets
- name: test merging of rulesets
uses: mikefarah/[email protected]
with:
cmd: yq eval-all '. as $item ireduce ({}; . *+ $item)' rulesets/src/*.ruleset.yml >> sps-api-standards.spectral.yml
- name: view merged rulesets
run: cat sps-api-standards.spectral.yml
release:
name: release
needs: [test]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: zip documentation
run: zip -r sps-api-standards-documentation.zip standards
- run: |
rm sps-api-standards.spectral.yml
name: remove existing merged rulesets
- name: merge spectral rulesets
uses: mikefarah/[email protected]
with:
cmd: yq eval-all '. as $item ireduce ({}; . *+ $item)' rulesets/src/*.ruleset.yml >> sps-api-standards.spectral.yml
- name: use node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: install release plugins
run: npm install -g semantic-release @semantic-release/git -D
- name: semantic release
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: azure pipelines publishing
uses: Azure/pipelines@v1
with:
azure-devops-project-url: https://dev.azure.com/spscommerce/api-lifecycle
azure-pipeline-name: 'sps-api-standards-cdn-publish'
azure-devops-token: ${{ secrets.AZURE_DEVOPS_TOKEN }}