Skip to content

Commit ce0941e

Browse files
committed
Add workflow to automate release creation
1 parent 13db56a commit ce0941e

File tree

3 files changed

+121
-1
lines changed

3 files changed

+121
-1
lines changed

.github/workflows/release-on-tag.yml

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Create Release on Tag
2-
2+
run-name: BuildTag ${{ github.ref }}
33
on:
44
push:
55
# Sequence of patterns matched against refs/tags
@@ -13,6 +13,113 @@ env:
1313
solutionDirectory: 'src/broadcast-solution'
1414
artifactlocation: '${{ github.workspace }}/dist'
1515
jobs:
16+
buildBroadCastJs:
17+
uses: ./.github/workflows/buildjs.yml
18+
with:
19+
projectdirectory: 'src/broadcast-typescript'
20+
componentName: broadcastjs
21+
publishArtifact: true
22+
testCommand: 'test:ci'
23+
publishCodeCov: false
24+
artifactlocation: '${{ github.workspace }}/dist'
25+
secrets:
26+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
27+
28+
29+
30+
buildAppModulePickerPCF:
31+
uses: ./.github/workflows/buildpcf.yml
32+
with:
33+
pcfdirectory: 'src/broadcast-pcf/appmodulepicker'
34+
publishArtifact: true
35+
componentName: AppModulePicker
36+
artifactlocation: '${{ github.workspace }}/dist'
37+
release:
38+
name: Create Release from tag
39+
needs: [ buildAppModulePickerPCF, buildBroadCastJs]
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- name: Install Power Platform Tools
46+
uses: microsoft/powerplatform-actions/actions-install@v1
47+
- name: Install GitVersion
48+
uses: gittools/actions/gitversion/[email protected]
49+
with:
50+
versionSpec: '6.3.x'
51+
- name: Determine Version
52+
id: gitversion # step id used as reference for output values
53+
uses: gittools/actions/gitversion/[email protected]
1654

55+
- name: Download broadcastjs artifact
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: broadcastjs
59+
path: '${{ github.workspace }}/broadcastjs'
60+
- name: Download AppModulePicker artifact
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: AppModulePicker
64+
path: '${{ github.workspace }}/AppModulePicker'
65+
- name: Rename broadcastjs/bundle.js into bbundle.js
66+
run: bundle.js bbundle.js
67+
working-directory: ${{ github.workspace }}/AppModulePicker
68+
- name: Update PCF control version with ${{ github.ref }}
69+
uses: Mudlet/[email protected]
70+
with:
71+
args: >-
72+
ed -L --update "/manifest/control/@version"
73+
-v "${{ steps.gitversion.outputs.majorMinorPatch }}"
74+
${{ github.workspace }}/AppModulePicker/ControlManifest.xml
75+
- name: Update Solution.xml Version with semver
76+
uses: Mudlet/[email protected]
77+
with:
78+
args: >-
79+
ed -L --update "/ImportExportXml/SolutionManifest/Version"
80+
-v "${{ steps.gitversion.outputs.assemblySemVer }}"
81+
${{ github.workspace }}/src/broadcast-solution/Other/Solution.xml
82+
- name: delete bundle.js from the solution directory
83+
run: |
84+
rm src/broadcast-solution/Controls/fdn_Broadcast.AppModulePicker/bundle.js
85+
- name: Pack solution
86+
uses: microsoft/powerplatform-actions/pack-solution@v1
87+
with:
88+
solution-folder: src/broadcast-solution
89+
map-file: src/solution-mapping-pack.xml
90+
solution-file: BroadcastSolution_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
91+
solution-type: Both
92+
- name: Create Release
93+
id: create_release
94+
uses: actions/create-release@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
tag_name: ${{ github.ref }}
99+
release_name: Release ${{ github.ref }}
100+
draft: false
101+
prerelease: false
102+
- name: Upload Unmanaged Release Solution
103+
id: upload-release-asset
104+
uses: actions/upload-release-asset@v1
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
with:
108+
upload_url: ${{ steps.create_release.outputs.upload_url }}
109+
asset_path: ./BroadcastSolution_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
110+
asset_name: BroadcastSolution_v${{ steps.gitversion.outputs.majorMinorPatch }}.zip
111+
asset_content_type: application/zip
112+
- name: Upload Managed Release Solution
113+
id: upload-release-managed-asset
114+
uses: actions/upload-release-asset@v1
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
with:
118+
upload_url: ${{ steps.create_release.outputs.upload_url }}
119+
asset_path: ./BroadcastSolution_v${{ steps.gitversion.outputs.majorMinorPatch }}_Managed.zip
120+
asset_name: BroadcastSolution_v${{ steps.gitversion.outputs.majorMinorPatch }}_Managed.zip
121+
asset_content_type: application/zip
122+
123+
17124

18125

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,8 @@ vite.config.ts.timestamp-*
140140
src/broadcast-pcf/appmodulepicker/push.bat
141141
export-solution.ps1
142142
/.vs
143+
pack-solution.ps1
144+
BroadcastSolution_managed.zip
145+
.gitignore
146+
BroadcastSolution.zip
147+
src/solution-mapping-pack.local.xml

src/solution-mapping-pack.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Mapping>
3+
<!-- Match specific named files to an alternate folder -->
4+
<FileToFile map="broadcast.js" to="../../broadcastjs/broadcast.js" />
5+
<!-- you have to rename broadcast-pcf/appmodulepicker/out/controls/AppModulePicker/bundle.js with bbundle.js -->
6+
<!-- and delete Controls/fdn_Broadcast.AppModulePicker/bundle.js for it to work properly -->
7+
<FileToPath map="Controls/fdn_Broadcast.AppModulePicker/*.*" to="../../AppModulePicker/**" />
8+
</Mapping>

0 commit comments

Comments
 (0)