From 1fda2a1d37c1182177fdca55e38b98a85dc1fe05 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 1 Oct 2021 16:44:43 +0100 Subject: [PATCH] fix: :bug: Stop Devops from building and releasing, GH Actions will now call the APT Build --- .azuredevops/pipelines/publish-job.yml | 130 ++++++++++++------------- .github/workflows/build.yml | 52 +++++----- 2 files changed, 94 insertions(+), 88 deletions(-) diff --git a/.azuredevops/pipelines/publish-job.yml b/.azuredevops/pipelines/publish-job.yml index 78697830b..435582858 100644 --- a/.azuredevops/pipelines/publish-job.yml +++ b/.azuredevops/pipelines/publish-job.yml @@ -45,74 +45,74 @@ stages: steps: - template: templates/publish-os-steps.yml -- stage: deploy - jobs: - - job: - condition: and(succeeded(), eq(variables.isMain, true)) - steps: - - task: DownloadPipelineArtifact@2 - inputs: - buildType: 'current' - targetPath: '$(System.ArtifactsDirectory)' +# - stage: deploy +# jobs: +# - job: +# condition: and(succeeded(), eq(variables.isMain, true)) +# steps: +# - task: DownloadPipelineArtifact@2 +# inputs: +# buildType: 'current' +# targetPath: '$(System.ArtifactsDirectory)' - - task: PowerShell@2 - displayName: 'Get Release Notes' - inputs: - targetType: 'inline' - script: | - $response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)" - Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response" +# - task: PowerShell@2 +# displayName: 'Get Release Notes' +# inputs: +# targetType: 'inline' +# script: | +# $response = Invoke-WebRequest -Uri "https://ombireleasenote.azurewebsites.net/api/ReleaseNotesFunction?buildId=$(Build.BuildId)" +# Write-Host "##vso[task.setvariable variable=ReleaseNotes;]$response" - - task: GitHubRelease@1 - displayName: 'Ombi.Releases Release' - inputs: - gitHubConnection: 'PAT' - repositoryName: 'Ombi-app/Ombi.Releases' - action: 'create' - target: 'c7fcbb77b58aef1076d635a9ef99e4374abc8672' - tagSource: 'userSpecifiedTag' - tag: '$(gitTag)' - releaseNotesSource: 'inline' - releaseNotesInline: '$(ReleaseNotes)' - assets: | - $(System.ArtifactsDirectory)/**/*.zip - $(System.ArtifactsDirectory)/**/*.tar.gz - isPreRelease: true - changeLogCompareToRelease: 'lastNonDraftRelease' - changeLogType: 'commitBased' +# - task: GitHubRelease@1 +# displayName: 'Ombi.Releases Release' +# inputs: +# gitHubConnection: 'PAT' +# repositoryName: 'Ombi-app/Ombi.Releases' +# action: 'create' +# target: 'c7fcbb77b58aef1076d635a9ef99e4374abc8672' +# tagSource: 'userSpecifiedTag' +# tag: '$(gitTag)' +# releaseNotesSource: 'inline' +# releaseNotesInline: '$(ReleaseNotes)' +# assets: | +# $(System.ArtifactsDirectory)/**/*.zip +# $(System.ArtifactsDirectory)/**/*.tar.gz +# isPreRelease: true +# changeLogCompareToRelease: 'lastNonDraftRelease' +# changeLogType: 'commitBased' - - task: GitHubRelease@1 - displayName: 'Ombi Release' - inputs: - gitHubConnection: 'PAT' - repositoryName: 'Ombi-app/Ombi' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'userSpecifiedTag' - tag: '$(gitTag)' - releaseNotesSource: 'inline' - releaseNotesInline: '$(ReleaseNotes)' - assets: | - $(System.ArtifactsDirectory)/**/*.zip - $(System.ArtifactsDirectory)/**/*.tar.gz - isPreRelease: true - changeLogCompareToRelease: 'lastNonDraftRelease' - changeLogType: 'commitBased' +# - task: GitHubRelease@1 +# displayName: 'Ombi Release' +# inputs: +# gitHubConnection: 'PAT' +# repositoryName: 'Ombi-app/Ombi' +# action: 'create' +# target: '$(Build.SourceVersion)' +# tagSource: 'userSpecifiedTag' +# tag: '$(gitTag)' +# releaseNotesSource: 'inline' +# releaseNotesInline: '$(ReleaseNotes)' +# assets: | +# $(System.ArtifactsDirectory)/**/*.zip +# $(System.ArtifactsDirectory)/**/*.tar.gz +# isPreRelease: true +# changeLogCompareToRelease: 'lastNonDraftRelease' +# changeLogType: 'commitBased' - - task: PowerShell@2 - displayName: "Trigger APT build" - inputs: - targetType: 'inline' - script: | - $body = @{ - "ref"="main" - "inputs"= @{"version"= "$(gitTag)"} - } | ConvertTo-Json +# - task: PowerShell@2 +# displayName: "Trigger APT build" +# inputs: +# targetType: 'inline' +# script: | +# $body = @{ +# "ref"="main" +# "inputs"= @{"version"= "$(gitTag)"} +# } | ConvertTo-Json - $header = @{ - "Accept"="application/vnd.github.v3+json" - "Authorization"="Bearer $(APTPAT)" - "User-Agent"="Ombi" - } +# $header = @{ +# "Accept"="application/vnd.github.v3+json" +# "Authorization"="Bearer $(APTPAT)" +# "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 \ No newline at end of file +# Invoke-RestMethod -Uri "https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches" -Method 'Post' -Body $body -Headers $header \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 215201182..17ad0c3bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,8 +4,6 @@ on: push: # branches: [ develop, feature/** ] branches: [ releaseNotes ] - pull_request: - branches: [ develop ] jobs: build-ui: @@ -182,14 +180,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # - name: Conventional Changelog Action - # id: changelog - # uses: TriPSs/conventional-changelog-action@v3 - # with: - # github-token: ${{ secrets.github_token }} - # git-message: 'chore(release): {version}' - # version-file: 'version.json' - # output-file: 'CHANGELOG.md' + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.github_token }} + git-message: 'chore(release): {version}' + version-file: 'version.json' + output-file: 'CHANGELOG.md' - name: Download Artifacts id: download @@ -197,28 +195,36 @@ jobs: with: 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 # uses: softprops/action-gh-release@v1 # # if: startsWith(github.ref, 'refs/tags/') # with: - # body: ${{ steps.changelog.outputs.clean_changelog }} + # body: 'Test' # draft: 'true' - # name: ${{ steps.changelog.outputs.tag }} - # tag_name: ${{ steps.changelog.outputs.tag }} + # name: 'Test' # files: | # artifacts/**/*.tar.gz # artifacts/**/*.zip - - name: Publish to GitHub - uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') + - name: Trigger APT Build + uses: fjogeleit/http-request-action@master with: - body: 'Test' - draft: 'true' - name: 'Test' - files: | - artifacts/**/*.tar.gz - artifacts/**/*.zip - + 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'}"