Skip to content

Commit 9ad88f0

Browse files
authored
Merge pull request #2 from pawanjenu/test-ci-cd
Add workflows
2 parents 9ee45e2 + 3157ec6 commit 9ad88f0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/main.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Build and Release
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
inputs:
14+
tag:
15+
description: 'tag number'
16+
required: true
17+
18+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
19+
jobs:
20+
# This workflow contains a single job called "build"
21+
build:
22+
# The type of runner that the job will run on
23+
runs-on: ubuntu-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v2
29+
30+
# Runs a single command using the runners shell
31+
- name: Install Npm dependencies
32+
run: npm install
33+
34+
# Runs a set of commands using the runners shell
35+
- name: Npm build
36+
run: npm run build
37+
38+
# Runs a set of commands using the runners shell
39+
- name: Zip disk folder
40+
run: |
41+
cd ./dist/LeetcodeSessionManager
42+
zip -r ../../LeetcodeSessionManager-$(node -p "require('../../package.json').version").zip .
43+
44+
- name: 'Create GitHub Release'
45+
uses: softprops/action-gh-release@v1
46+
with:
47+
files: ./LeetcodeSessionManager*.zip
48+
tag_name: v${{ github.run_number }}
49+
name: Release V${{ github.run_number }}

0 commit comments

Comments
 (0)