diff --git a/azure-pipelines/fiskaltrust.Launcher-Release.yml b/azure-pipelines/fiskaltrust.Launcher-Release.yml index 8e39ec74..0860752e 100644 --- a/azure-pipelines/fiskaltrust.Launcher-Release.yml +++ b/azure-pipelines/fiskaltrust.Launcher-Release.yml @@ -28,6 +28,13 @@ stages: storage: stprodwesteuropepackages serviceConnection: rg-prod-westeurope-packages + - template: templates/stages/github-release.yml + parameters: + dependsOn: Release_Production + artifact: build + serviceConnection: fiskaltrust-github + repositoryName: fiskaltrust/middleware-launcher + - template: templates/deb/release.yml parameters: artifact: build diff --git a/azure-pipelines/templates/stages/github-release.yml b/azure-pipelines/templates/stages/github-release.yml new file mode 100644 index 00000000..0e674c52 --- /dev/null +++ b/azure-pipelines/templates/stages/github-release.yml @@ -0,0 +1,60 @@ +parameters: +- name: artifact + type: string + default: current + +- name: targets + type: object + default: + - win-x64 + - win-x86 + - linux-x64 + - linux-arm + - linux-arm64 + - osx-x64 + +- name: dependsOn + type: string + +- name: serviceConnection + type: string + +- name: repositoryName + type: string + + +stages: +- stage: Github_Release + displayName: Edit Github Release + dependsOn: ${{ parameters.dependsOn }} + + jobs: + - job: Release + pool: + vmImage: ubuntu-latest + steps: + + - ${{ each target in parameters.targets }}: + - download: ${{ parameters.artifact }} + artifact: drop-${{ target }} + displayName: "[${{ target }}] Download artifact" + + - pwsh: | + Get-ChildItem $(Pipeline.Workspace)/${{ parameters.artifact }}/ -Recurse -File | Where-Object { !($_ -match "fiskaltrust.Launcher(.exe)?") } | Remove-Item + Get-ChildItem $(Pipeline.Workspace)/${{ parameters.artifact }}/ -Recurse -Directory | %{ $_ -match "drop-(.*)"; Move-Item $_ $(Join-Path $_.Parent $Matches[1]); } + displayName: Prepare artifacts + + - ${{ each target in parameters.targets }}: + - bash: | + mkdir $(Build.ArtifactStagingDirectory)/zipped/ + cd $(Build.ArtifactStagingDirectory)/${{ parameters.artifact }}/{{ target }} + zip -r $(Build.ArtifactStagingDirectory)/zipped/{{ target }}.zip ./" + + - task: GitHubRelease@0 + displayName: "Edit GitHub Release" + inputs: + gitHubConnection: ${{ parameters.serviceConnection }} + repositoryName: ${{ parameters.repositoryName }} + action: edit + tag: $(Build.SourceBranchName) + assets: $(Build.ArtifactStagingDirectory)/zipped/*.zip \ No newline at end of file