fix: 🐛 Stop Devops from building and releasing, GH Actions will now call the APT Build

This commit is contained in:
tidusjar 2021-10-01 16:44:43 +01:00
commit 1fda2a1d37
2 changed files with 96 additions and 90 deletions

View file

@ -45,74 +45,74 @@ stages:
steps: steps:
- template: templates/publish-os-steps.yml - template: templates/publish-os-steps.yml
- stage: deploy # - stage: deploy
jobs: # jobs:
- job: # - job:
condition: and(succeeded(), eq(variables.isMain, true)) # condition: and(succeeded(), eq(variables.isMain, true))
steps: # steps:
- task: DownloadPipelineArtifact@2 # - task: DownloadPipelineArtifact@2
inputs: # inputs:
buildType: 'current' # buildType: 'current'
targetPath: '$(System.ArtifactsDirectory)' # targetPath: '$(System.ArtifactsDirectory)'
- task: PowerShell@2 # - task: PowerShell@2
displayName: 'Get Release Notes' # displayName: 'Get Release Notes'
inputs: # inputs:
targetType: 'inline' # targetType: 'inline'
script: | # script: |
$response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)" # $response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)"
Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response" # Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response"
- task: GitHubRelease@1 # - task: GitHubRelease@1
displayName: 'Ombi.Releases Release' # displayName: 'Ombi.Releases Release'
inputs: # inputs:
gitHubConnection: 'PAT' # gitHubConnection: 'PAT'
repositoryName: 'Ombi-app/Ombi.Releases' # repositoryName: 'Ombi-app/Ombi.Releases'
action: 'create' # action: 'create'
target: 'c7fcbb77b58aef1076d635a9ef99e4374abc8672' # target: 'c7fcbb77b58aef1076d635a9ef99e4374abc8672'
tagSource: 'userSpecifiedTag' # tagSource: 'userSpecifiedTag'
tag: '$(gitTag)' # tag: '$(gitTag)'
releaseNotesSource: 'inline' # releaseNotesSource: 'inline'
releaseNotesInline: '$(ReleaseNotes)' # releaseNotesInline: '$(ReleaseNotes)'
assets: | # assets: |
$(System.ArtifactsDirectory)/**/*.zip # $(System.ArtifactsDirectory)/**/*.zip
$(System.ArtifactsDirectory)/**/*.tar.gz # $(System.ArtifactsDirectory)/**/*.tar.gz
isPreRelease: true # isPreRelease: true
changeLogCompareToRelease: 'lastNonDraftRelease' # changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased' # changeLogType: 'commitBased'
- task: GitHubRelease@1 # - task: GitHubRelease@1
displayName: 'Ombi Release' # displayName: 'Ombi Release'
inputs: # inputs:
gitHubConnection: 'PAT' # gitHubConnection: 'PAT'
repositoryName: 'Ombi-app/Ombi' # repositoryName: 'Ombi-app/Ombi'
action: 'create' # action: 'create'
target: '$(Build.SourceVersion)' # target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag' # tagSource: 'userSpecifiedTag'
tag: '$(gitTag)' # tag: '$(gitTag)'
releaseNotesSource: 'inline' # releaseNotesSource: 'inline'
releaseNotesInline: '$(ReleaseNotes)' # releaseNotesInline: '$(ReleaseNotes)'
assets: | # assets: |
$(System.ArtifactsDirectory)/**/*.zip # $(System.ArtifactsDirectory)/**/*.zip
$(System.ArtifactsDirectory)/**/*.tar.gz # $(System.ArtifactsDirectory)/**/*.tar.gz
isPreRelease: true # isPreRelease: true
changeLogCompareToRelease: 'lastNonDraftRelease' # changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased' # changeLogType: 'commitBased'
- task: PowerShell@2 # - task: PowerShell@2
displayName: "Trigger APT build" # displayName: "Trigger APT build"
inputs: # inputs:
targetType: 'inline' # targetType: 'inline'
script: | # script: |
$body = @{ # $body = @{
"ref"="main" # "ref"="main"
"inputs"= @{"version"= "$(gitTag)"} # "inputs"= @{"version"= "$(gitTag)"}
} | ConvertTo-Json # } | ConvertTo-Json
$header = @{ # $header = @{
"Accept"="application/vnd.github.v3+json" # "Accept"="application/vnd.github.v3+json"
"Authorization"="Bearer $(APTPAT)" # "Authorization"="Bearer $(APTPAT)"
"User-Agent"="Ombi" # "User-Agent"="Ombi"
} # }
Invoke-RestMethod -Uri "https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches" -Method 'Post' -Body $body -Headers $header # Invoke-RestMethod -Uri "https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches" -Method 'Post' -Body $body -Headers $header

View file

@ -4,8 +4,6 @@ on:
push: push:
# branches: [ develop, feature/** ] # branches: [ develop, feature/** ]
branches: [ releaseNotes ] branches: [ releaseNotes ]
pull_request:
branches: [ develop ]
jobs: jobs:
build-ui: build-ui:
@ -182,14 +180,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
# - name: Conventional Changelog Action - name: Conventional Changelog Action
# id: changelog id: changelog
# uses: TriPSs/conventional-changelog-action@v3 uses: TriPSs/conventional-changelog-action@v3
# with: with:
# github-token: ${{ secrets.github_token }} github-token: ${{ secrets.github_token }}
# git-message: 'chore(release): {version}' git-message: 'chore(release): {version}'
# version-file: 'version.json' version-file: 'version.json'
# output-file: 'CHANGELOG.md' output-file: 'CHANGELOG.md'
- name: Download Artifacts - name: Download Artifacts
id: download id: download
@ -197,28 +195,36 @@ jobs:
with: with:
path: artifacts path: artifacts
# - name: Publish to GitHub
# uses: softprops/action-gh-release@v1
# # if: startsWith(github.ref, 'refs/tags/')
# with:
# body: ${{ steps.changelog.outputs.clean_changelog }}
# draft: 'true'
# name: ${{ steps.changelog.outputs.tag }}
# tag_name: ${{ steps.changelog.outputs.tag }}
# files: |
# artifacts/**/*.tar.gz
# artifacts/**/*.zip
- name: Publish to GitHub - name: Publish to GitHub
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
with: with:
body: 'Test' body: ${{ steps.changelog.outputs.clean_changelog }}
draft: 'true' draft: 'true'
name: 'Test' name: ${{ steps.changelog.outputs.tag }}
tag_name: ${{ steps.changelog.outputs.tag }}
files: | files: |
artifacts/**/*.tar.gz artifacts/**/*.tar.gz
artifacts/**/*.zip artifacts/**/*.zip
# - name: Publish to GitHub
# uses: softprops/action-gh-release@v1
# # if: startsWith(github.ref, 'refs/tags/')
# with:
# body: 'Test'
# draft: 'true'
# name: 'Test'
# files: |
# artifacts/**/*.tar.gz
# artifacts/**/*.zip
- name: Trigger APT Build
uses: fjogeleit/http-request-action@master
with:
url: 'https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches'
method: 'POST'
contentType: 'application/json'
data: "{ 'ref':'main', 'inputs': { 'version': '${{ steps.changelog.outputs.tag }}'} }"
customHeaders: "{'Accept':'application/vnd.github.v3+json', 'Authorization':'Bearer ${{secrets.APT_PAT}}', 'User-Agent':'Ombi'}"