This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
96 lines (85 loc) · 2.84 KB
/
main.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
# v1.1.3
name: Theme CI
on:
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
branches:
[master, dev]
pull_request:
branches:
[master, dev]
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
jobs:
ci:
runs-on: ubuntu-latest
env:
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
BLOB_SAS: ${{ secrets.BLOB_TOKEN }}
VERSION_SUFFIX: ""
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Get Image Version
uses: VirtoCommerce/vc-github-actions/get-image-version@master
id: image
- name: Set VERSION_SUFFIX variable
run: |
if [ '${{ github.event_name }}' = 'workflow_dispatch' ]; then
echo "VERSION_SUFFIX=${{ steps.image.outputs.fullSuffix }}" >> $GITHUB_ENV
else
echo "VERSION_SUFFIX=${{ steps.image.outputs.suffix }}" >> $GITHUB_ENV
fi;
- name: Get changelog
id: changelog
uses: VirtoCommerce/vc-github-actions/changelog-generator@master
- name: SonarCloud Scan
uses: VirtoCommerce/vc-github-actions/sonar-theme@master
with:
projectVersion: ${{ steps.image.outputs.fullVersion }}
- name: Build
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.event_name == 'workflow_dispatch' }}
id: build
uses: VirtoCommerce/vc-github-actions/build-theme@master
with:
versionSuffix: ${{ env.VERSION_SUFFIX }}
- name: Publish
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master')}}
id: publish
uses: VirtoCommerce/vc-github-actions/publish-theme@master
with:
artifactPath: ${{ steps.build.outputs.artifactPath }}
artifactName: ${{ steps.build.outputs.artifactName }}
- name: Create Release
if: ${{ github.ref == 'refs/heads/master' }}
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.image.outputs.prefix }}
release_name: ${{ steps.image.outputs.prefix }}
draft: false
prerelease: false
body: ${{ steps.changelog.outputs.changelog }}
- name: Upload Release Asset
if: ${{ github.ref == 'refs/heads/master' }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.build.outputs.artifactPath }}
asset_name: ${{ steps.build.outputs.artifactName }}
asset_content_type: application/zip