File tree Expand file tree Collapse file tree 2 files changed +94
-1
lines changed
Expand file tree Collapse file tree 2 files changed +94
-1
lines changed Original file line number Diff line number Diff line change 1- name : Build
1+ name : Build and Publish Httpsnippet
22
33on :
44 push :
55 branches :
66 - master
7+ tags :
8+ - ' *' # Restrict any specific tag formats
79 pull_request :
810 types :
911 - opened
1012 - synchronize
1113 workflow_dispatch :
1214
1315jobs :
16+ scan :
17+ permissions :
18+ packages : write
19+ contents : write # publish sbom to GH releases/tag assets
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout branch
23+ uses : actions/checkout@v3
24+ with :
25+ path : ${{ github.repository }}
26+
27+ # Perform SCA analysis for the code repository
28+ # Produces SBOM and CVE report
29+ # Helps understand vulnerabilities / license compliance across third party dependencies
30+ - id : sca-project
31+ uses : Kong/public-shared-actions/security-actions/sca@2f02738ecb1670f01391162e43fe3f5d4e7942a1 # v2.2.2
32+ with :
33+ dir : ${{ github.repository }}
34+ upload-sbom-release-assets : true
35+
1436 build :
1537 runs-on : ubuntu-latest
1638 strategy :
3759
3860 - name : Build
3961 run : npm run build
62+
63+ publish :
64+ runs-on : ubuntu-latest
65+ if : ${{ github.ref_type == 'tag' && github.repository_owner == 'Kong' }}
66+ steps :
67+ # checkout tag
68+ - name : Checkout code
69+ uses : actions/checkout@v4
70+ with :
71+ fetch-depth : 0
72+
73+ - name : Setup Node.js
74+ uses : actions/setup-node@v4
75+ with :
76+ node-version : 20.9.0
77+ registry-url : ' https://registry.npmjs.org'
78+
79+ - name : Install
80+ run : npm ci
81+
82+ - name : Build
83+ run : npm run build
84+
85+ - name : Publish to NPM
86+ run : npm publish --no-git-checks --provenance --tag ${{ github.sha }}
87+ env :
88+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
89+
Original file line number Diff line number Diff line change 1+ name : Release httpsnippet
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Tag version to release'
8+ required : true
9+
10+ env :
11+ # Release Tag to build and publish
12+ TAG : ${{ github.event.inputs.version }}
13+
14+ jobs :
15+ release :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
22+
23+ - name : Configure Git user
24+ uses : Homebrew/actions/git-user-config@master
25+ with :
26+ username : ${{ (github.event_name == 'workflow_dispatch' && github.actor) || 'insomnia-infra' }}
27+
28+ - name : Tag the Repository
29+ run : |
30+ git tag ${{ env.TAG }}
31+ git push origin ${{ env.TAG }}
32+
33+ - name : Create Tag and Release
34+ uses : ncipollo/release-action@v1
35+ id : core_tag_and_release
36+ with :
37+ tag : ${{ env.TAG }}
38+ name : " httpsnippet ${{ env.TAG }} 📦"
39+ generateReleaseNotes : true
40+ prerelease : false
41+ draft : false
42+ env :
43+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments