Skip to content

Commit

Permalink
Merge pull request #125 from fiskaltrust/add-binaries-to-releases
Browse files Browse the repository at this point in the history
Add binaries to github releases
  • Loading branch information
volllly authored Oct 31, 2023
2 parents 3da697f + 55c36c6 commit 8416cd0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
7 changes: 7 additions & 0 deletions azure-pipelines/fiskaltrust.Launcher-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
60 changes: 60 additions & 0 deletions azure-pipelines/templates/stages/github-release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8416cd0

Please sign in to comment.