Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binaries to github releases #125

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading