-
Notifications
You must be signed in to change notification settings - Fork 21
91 lines (82 loc) · 2.82 KB
/
Create_New_Version.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
---
name: Create New Version
on:
workflow_dispatch:
inputs:
version:
type: choice
default: "Patch"
description: Select next release type
options:
- Patch
- Minor
- Major
required: true
pre-release:
type: boolean
description: Set as Pre-release version
permissions:
contents: write
jobs:
build:
name: Create Release Asset
runs-on: ubuntu-latest
outputs:
Build_Version: ${{ steps.versioning.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Auto Increment Semver Action
uses: MCKanpolat/[email protected]
id: versioning
with:
releaseType: ${{ github.event.inputs.version }}
incrementPerCommit: false
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Powershell Version
#Replace line 12 with new version
run: sed -i '12s/.*/$Script:WingetIntunePackager = "${{ steps.versioning.outputs.version }}"/g' sources/WingetIntunePackager.ps1
- name: Commit & Push
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
message: "Changed version to ${{ steps.versioning.outputs.version }}"
Packaging:
runs-on: windows-latest
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref }} #needed to get latest commit
- name: Compile EXE
env:
Version: ${{needs.build.outputs.Build_Version}}
shell: powershell
working-directory: .
run: |
"Setting Version Number"
[String]$Version="$env:Version"
"Version is $Version"
"Installing Module PS2EXE"
Install-Module -Name ps2exe -force
"Impoting Module PS2EXE"
Import-Module -Name ps2exe
"Setting App Info"
$Input = ".\sources\WingetIntunePackager.ps1"
$Output = ".\WingetIntunePackager.exe"
$Icon = ".\sources\WingetIntunePackager.ico"
$Title = "Winget Intune Packager"
$Description = "Intune Winget app packager"
"Creating EXE"
Invoke-PS2EXE -inputFile $Input -outputFile $Output -iconFile $Icon -product $Title -version $Version -title $Description -copyright 'Romanitho' -noConsole -noerror -Verbose -ErrorAction Stop
- name: Create release
uses: "ncipollo/[email protected]"
with:
tag: "v${{needs.build.outputs.Build_Version}}"
prerelease: ${{ github.event.inputs.pre-release }}
generateReleaseNotes: true
name: "v${{needs.build.outputs.Build_Version}}"
artifacts: WingetIntunePackager.exe