This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
Create New Version #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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@v4 | |
- name: Auto Increment Semver Action | |
uses: MCKanpolat/auto-semver-action@1.0.10 | |
id: versioning | |
with: | |
releaseType: ${{ github.event.inputs.version }} | |
incrementPerCommit: false | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update Powershell Version | |
run: sed -i '20s/.*/$Script:WiGuiVersion = "${{ steps.versioning.outputs.version }}"/g' Sources/Winget-Install-GUI.ps1 | |
- name: Commit & Push | |
uses: actions-js/push@v1.4 | |
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@v4 | |
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\Winget-Install-GUI.ps1" | |
$Output = ".\WiGui.exe" | |
$Icon = ".\Sources\WiGui.ico" | |
$Title = "WiGui" | |
$Description = "Install Winget Apps and configure WAU" | |
"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/release-action@v1" | |
with: | |
tag: "v${{needs.build.outputs.Build_Version}}" | |
prerelease: ${{ github.event.inputs.pre-release }} | |
generateReleaseNotes: true | |
name: "v${{needs.build.outputs.Build_Version}}" | |
artifacts: WiGui.exe |