-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (108 loc) · 3.3 KB
/
pr.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
name: Pull Request
on:
pull_request:
push:
tags:
- '*'
jobs:
package:
name: Package
runs-on: ubuntu-latest
container:
image: ghcr.io/tektronix/tsp-toolkit-build:latest
credentials:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
steps:
- name: Tool Versions
run: npm --version
- name: Checkout
uses: actions/checkout@v3
- name: npm Package
run: |
cd WebHelpDocs
npm pack
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: WebHelpDocs
path: ./WebHelpDocs/*.tgz
publish:
name: Publish
if: startsWith(github.ref, 'refs/tags/')
needs:
- package
runs-on: ubuntu-latest
container:
image: ghcr.io/tektronix/tsp-toolkit-build:latest
credentials:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
#https://github.com/actions/runner/issues/2033#issuecomment-1598547465
options: --user 1001
steps:
- name: Tool Versions
run: npm --version
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@tektronix'
- name: Checkout
uses: actions/checkout@v3
with:
set-safe-directory: '*'
# - name: Get Tagged Version
# id: lasttag
# run: |
# V="${GITHUB_REF#refs/tags/v}"
# CL="${V%-*}"
# echo "version=${V}" >> $GITHUB_OUTPUT
# echo "cl_version=${CL}" >> $GITHUB_OUTPUT
# # set version to RC version if this is a tagged build
# npm version --no-git-tag-version --allow-same-version "$V"
# if: startsWith(github.ref, 'refs/tags/')
- name: Get Artifacts
uses: actions/[email protected]
with:
name: WebHelpDocs
- name: publish pack
run: |
npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs:
- publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Tagged Version
id: lasttag
run: |
V="${GITHUB_REF#refs/tags/v}"
CL="${V%-*}"
echo "version=${V}" >> $GITHUB_OUTPUT
echo "cl_version=${CL}" >> $GITHUB_OUTPUT
- name: Get Changelog for this Tag
id: changelog
uses: coditory/changelog-parser@v1
with:
version: ${{steps.lasttag.outputs.cl_version}}
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: ${{steps.lasttag.outputs.version}}
artifacts: target/*,sbom/**/*
body: |
## Features Requests / Bugs
If you find issues or have a feature request, please enter a [new issue on GitHub](https://github.com/tektronix/tsp-toolkit-kic-cli/issues/new).
## Installation
View the installation instructions in the [README](https://github.com/tektronix/tsp-toolkit-kic-cli/blob/main/README.md)
## Changelog
${{steps.changelog.outputs.description}}
prerelease: true
makeLatest: true