-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (76 loc) · 3.15 KB
/
Copy pathworkflow.yaml
File metadata and controls
91 lines (76 loc) · 3.15 KB
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
name: "Build & Deploy"
on:
push:
branches:
- 'feature/**' # match an pushes on feature/* and feature/<any sub branch>/*
- main
paths-ignore: # dont run when changes made to these folders
- '.vscode/**'
- '.github/**'
- 'GitVersion.yml'
- '.eslintrc.json'
- 'test/**'
jobs:
cicd:
name: CI/CD
runs-on: windows-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: fetch all history and tags from all branches for gitversion
run: git fetch --prune --unshallow
- name: install gitversion tool
uses: gittools/actions/gitversion/setup@v0.9.13
with:
versionSpec: '5.1.x'
- name: execute gitversion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v0.9.13
- name: print gitversion
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
- name: setup node
uses: actions/setup-node@v3.4.1
with:
node-version: '12.x'
- name: clean install dependencies
run: npm ci
- name: update metadata in package.json
uses: onlyutkarsh/patch-files-action@v1.0.4
with:
files: '${{github.workspace}}/package.json'
patch-syntax: |
= /version => "${{ steps.gitversion.outputs.majorMinorPatch }}"
= /displayName => "PowerApps Portal Local Development"
= /description => "Local source control for Power Apps portals code for web files like images or style sheets, web templates and content snippets."
- name: add version in CHANGELOG.md
uses: cschleiden/replace-tokens@v1
with:
files: '${{github.workspace}}/CHANGELOG.md'
env:
VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}"
- name: compile and create vsix
run: npm run package
- name: print vsix path
run: |
echo "VSIX Path: ${{ env.vsix_path }}"
- name: upload vsix as artifact
uses: actions/upload-artifact@v3.1.2
with:
name: powerapps-portal-local-development-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
path: ${{github.workspace}}/powerapps-portal-local-development-${{steps.gitversion.outputs.majorMinorPatch}}.vsix
- name: publish to marketplace
if: github.ref == 'refs/heads/main'
run: npm run deploy ${{ secrets.PAT }}
- name: create a release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.gitversion.outputs.majorMinorPatch }}
release_name: v${{ steps.gitversion.outputs.majorMinorPatch }}