forked from shashirajraja/onlinebookstore
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.68 KB
/
build.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
name: OnilineBookStore CI
on: [pull]
jobs:
build-project:
name: Build Project
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- run: mvn --batch-mode --update-snapshots verify
- run: mkdir staging && cp target/*.war staging
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: onlinebookstore
path: staging
release-project:
name: Release Project
runs-on: ubuntu-latest
needs: build-project
steps:
- name: download artifacts
uses: actions/download-artifact@v3
with:
name: onlinebookstore
path: staging
- name: Test the arifacts
run: ls -R
- name: archieve artifacts
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'onlinebookstore.zip'
- name: Create a release
id: create-new-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number}}
release_name: Release ${{ github.run_number }}
- name: Upload Release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-new-release.outputs.upload_url }}
asset_path: onlinebookstore.zip
asset_name: onlinebookstore-v${{ github.run_number }}.zip
asset_content_type: application/zip