-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (110 loc) · 4.32 KB
/
ci.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
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
name: ci
on:
workflow_dispatch:
push:
branches:
- main
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
release_tag_name: ${{ steps.release.outputs['tag_name'] }}
release_upload_url: ${{ steps.release.outputs['upload_url'] }}
env:
GITHUB_REF: ${{ github.ref }}
GITHUB_TOKEN: ${{ secrets.PAT }}
DIST_FILE_NAME: ctrl-q-nr
steps:
- name: Show github.ref
run: echo "$GITHUB_REF"
- uses: google-github-actions/release-please-action@v3
id: release
if: github.repository_owner == 'ptarmiganlabs'
with:
# command: manifest
# bootstrap-sha: ad2255c9c24f68d0adb5255159fa5a849ab880e4
# last-release-sha: b6266be9857c88405364c8af54fbfbed83bb9f66
release-as: 0.0.1
release-type: node
package-name: ctrl-q-nr
default-branch: main
prerelease: true
release-search-depth: 5
commit-search-depth: 200
draft: true
changelog-types: '[{"type": "feat","section": "Features","hidden": false},{"type": "fix","section": "Bug Fixes","hidden": false},{"type": "chore","section": "Miscellaneous","hidden": false},{"type": "refactor","section": "Refactoring","hidden": false},{"type": "docs","section": "Documentation","hidden": false},{"type": "build","section": "Miscellaneous","hidden": false}]'
- name: Show output from Release-Please
if: always()
env:
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }}
run: echo "$RELEASE_PLEASE_OUTPUT"
- name: Show output from Release-Please
run: |
echo "releases_created: ${{ steps.release.outputs.releases_created }}"
echo "release_created : ${{ steps.release.outputs.release_created }}"
echo "draft : ${{ steps.release.outputs['draft'] }}"
echo "path : ${{ steps.release.outputs['path'] }}"
echo "upload_url : ${{ steps.release.outputs['upload_url'] }}"
echo "html_url : ${{ steps.release.outputs['html_url'] }}"
echo "tag_name : ${{ steps.release.outputs['tag_name'] }}"
echo "version : ${{ steps.release.outputs['version'] }}"
echo "major : ${{ steps.release.outputs['major'] }}"
echo "minor : ${{ steps.release.outputs['minor'] }}"
echo "patch : ${{ steps.release.outputs['patch'] }}"
echo "sha : ${{ steps.release.outputs['sha'] }}"
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: |
pwd
npm ci
- name: Run Snyk to check for vulnerabilities
if: |
github.repository_owner == 'ptarmiganlabs'
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --file=./package.json --sarif-file-output=snyk.sarif
# command: test
- name: Upload Snyk result to GitHub Code Scanning
if: |
github.repository_owner == 'ptarmiganlabs'
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif
release-linux:
needs: release-please
runs-on: ubuntu-latest
# timeout-minutes: 15
if: ${{ needs.release-please.outputs.releases_created }}
env:
DIST_FILE_NAME: ctrl-q-nr
GITHUB_TOKEN: ${{ secrets.PAT }}
steps:
- name: Release tag and upload url from previous job
run: |
echo "tag_name : ${{ needs.release-please.outputs.release_tag_name }}"
echo "upload_url : ${{ needs.release-please.outputs.release_upload_url }}"
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: |
pwd
npm ci
- name: Publish to npm
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
access: public
strategy: all