From a64454db57dd2e12bf8243f907c4c13281a183d5 Mon Sep 17 00:00:00 2001 From: Tim Schneider <43130816+DerStimmler@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:12:48 +0100 Subject: [PATCH] ci: add pr workflow --- .github/workflows/pr.yml | 60 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 18 ++++++++--- 2 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..5d6a62e --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,60 @@ +name: PR + +on: + pull_request: + workflow_dispatch: + +jobs: + pr: + runs-on: windows-latest + permissions: + packages: read + contents: read + steps: + - name: Repository laden + uses: actions/checkout@v4 + + - name: .NET installieren + uses: actions/setup-dotnet@v4 + + - name: GitHub Package Manager registrieren + run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/co-IT/index.json" + + - name: Install Tools + run: dotnet tool restore + + - name: Install Dependencies + run: dotnet restore + + - name: Lint + run: dotnet csharpier --check . + + - name: Anwendung bauen + run: dotnet publish -c Release -r win-x64 ${{ github.workspace }}\coIT.Toolkit.Lexoffice.GdiExport.csproj --property:PublishProfile="FolderProfile" + + - name: Installer bauen + uses: caphyon/advinst-github-action@v2.0 + with: + advinst-version: '21.9' + advinst-license: ${{ secrets.ADVINST_LICENSE_KEY }} + advinst-enable-automation: 'true' + aip-path: ${{ github.workspace }}\coIT.Toolkit.Lexoffice.GdiExport.Installer.aip + aip-build-name: DefaultBuild + aip-package-name: coIT.Toolkit.Lexoffice.GdiExport.Installer-0.0.0.msi + aip-output-dir: ${{ github.workspace }}\setup + aip-commands: | + SetVersion 0.0.0 + + - name: Update json erstellen + env: + VERSION: 0.0.0 + run: | + # JSON String erstellen + $jsonString = '{"RegistryKey":"HKUD\\Software\\\\co-IT.eu GmbH\\Lexoffice Gdi Export\\Version", "Version":"' + $env:VERSION + '"}' + + # Datei erstellen + $jsonString | Set-Content -Path advinst_update.json + + # Dbug Ausgabe + Write-Output (Resolve-Path advinst_update.json) + Get-Content advinst_update.json diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a12ff69..4549bea 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,6 @@ on: jobs: publish: runs-on: windows-latest - name: ClockodoQuickActions Installer Bauen permissions: packages: write contents: write @@ -23,9 +22,18 @@ jobs: - name: GitHub Package Manager registrieren run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/co-IT/index.json" + - name: Install Tools + run: dotnet tool restore + + - name: Install Dependencies + run: dotnet restore + + - name: Lint + run: dotnet csharpier --check . + - name: Anwendung bauen run: dotnet publish -c Release -r win-x64 ${{ github.workspace }}\coIT.Toolkit.Lexoffice.GdiExport.csproj --property:PublishProfile="FolderProfile" - + - name: Installer bauen uses: caphyon/advinst-github-action@v2.0 with: @@ -38,7 +46,7 @@ jobs: aip-output-dir: ${{ github.workspace }}\setup aip-commands: | SetVersion ${{github.ref_name}} - + - name: Installer zu release hinzufügen uses: svenstaro/upload-release-action@v2 with: @@ -53,10 +61,10 @@ jobs: run: | # JSON String erstellen $jsonString = '{"RegistryKey":"HKUD\\Software\\\\co-IT.eu GmbH\\Lexoffice Gdi Export\\Version", "Version":"' + $env:VERSION + '"}' - + # Datei erstellen $jsonString | Set-Content -Path advinst_update.json - + # Dbug Ausgabe Write-Output (Resolve-Path advinst_update.json) Get-Content advinst_update.json