Skip to content

Commit 54ff7d9

Browse files
refactor: Github workflow updated
1 parent 438dbb0 commit 54ff7d9

3 files changed

Lines changed: 52 additions & 39 deletions

File tree

.github/workflows/jira.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3.5.3
1111
- name: Login into JIRA
1212
uses: atlassian/gajira-login@master
1313
env:

.github/workflows/release.yml

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,63 @@
11
name: Release
2-
32
on:
43
push:
5-
branches: [main]
6-
4+
branches:
5+
- main
76
jobs:
87
build:
8+
name: Build and upload
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v1
11+
- name: Checkout
12+
uses: actions/checkout@v3.5.3
1313
with:
14-
node-version: "16.x"
15-
- run: npm install
16-
17-
- name: get-package-details
18-
id: package
19-
uses: codex-team/action-nodejs-package-info@v1.1
20-
- name: install npm packall
21-
run: npm install npm-pack-all
14+
fetch-depth: 0
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3.7.0
17+
with:
18+
node-version: "18.x"
19+
- name: Installing dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run prepack
23+
- name: Upload dist
24+
uses: actions/upload-artifact@v3.1.2
25+
with:
26+
name: lib
27+
path: lib
2228

23-
- run: node node_modules/.bin/npm-pack-all
24-
- uses: Klemensas/action-autotag@stable
25-
id: update_tag
29+
release:
30+
name: Download dist and release
31+
runs-on: ubuntu-latest
32+
needs: build
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3.5.3
2636
with:
27-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
28-
tag_prefix: "v"
29-
- name: Create Release
30-
if: steps.update_tag.outputs.tagname
31-
uses: actions/create-release@v1
32-
id: create_release
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
37+
fetch-depth: 0
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v3.7.0
40+
with:
41+
node-version: "18.x"
42+
- name: Installing dependencies
43+
run: npm install
44+
- name: Download dist
45+
uses: actions/download-artifact@v3
3546
with:
36-
tag_name: ${{ steps.update_tag.outputs.tagname }}
37-
release_name: Release ${{ steps.update_tag.outputs.tagname }}
38-
draft: false # Default value, but nice to set explicitly
39-
prerelease: false # Default value, but nice to set explicitly
40-
- name: Upload Release Asset
41-
if: steps.update_tag.outputs.tagname
42-
id: upload-release-asset
43-
uses: actions/upload-release-asset@v1
47+
name: lib
48+
path: lib
49+
- name: Display dirs
50+
run: ls -R
51+
- name: Release
52+
id: release-plugin
53+
uses: JS-DevTools/npm-publish@v2.2.0
54+
with:
55+
token: ${{ secrets.NPM_TOKEN }}
56+
- name: get-npm-version
57+
id: package-version
58+
uses: martinbeentjes/npm-get-version-action@v1.3.1
59+
- name: github-release
60+
id: github-release
4461
env:
4562
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
48-
asset_path: ./contentstack-launch-cli-${{ steps.package.outputs.version }}.tgz
49-
asset_name: contentstack-launch-cli-${{ steps.package.outputs.version }}.tgz
50-
asset_content_type: application/tgz
63+
run: gh release create v${{ steps.release-plugin.outputs.version }} --title "Release ${{ steps.release-plugin.outputs.version }}" --generate-notes

.github/workflows/sast-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ jobs:
66
security:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3.5.3
1010
- name: Horusec Scan
1111
run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src horuszup/horusec-cli:latest horusec start -p /src -P $(pwd)

0 commit comments

Comments
 (0)