ci: 👷 Finished build and PR pipelines

pull/4329/head
tidusjar 3 years ago
parent 9287d83c13
commit 44e573d993

@ -2,8 +2,7 @@ name: CI Build
on: on:
push: push:
# branches: [ develop, feature/** ] branches: [ develop, master ]
branches: [ releaseNotes ]
jobs: jobs:
build-ui: build-ui:
@ -54,40 +53,35 @@ jobs:
cd src cd src
dotnet test --logger trx --results-directory "TestResults" dotnet test --logger trx --results-directory "TestResults"
## Don't need yet versioning:
# - name: Upload dotnet test results runs-on: ubuntu-latest
# uses: actions/upload-artifact@v2 outputs:
# with: changelog: ${{ steps.changelog.outputs.clean_changelog }}
# name: dotnet-results tag: ${{ steps.changelog.outputs.tag }}
# path: src/TestResults version: ${{ steps.changelog.outputs.version }}
# # Use always() to always run this step to publish test results when there are test failures steps:
# if: ${{ always() }} - uses: actions/checkout@v2
# This is only to get the next version number so we can set the version before compile
# versioning: - name: Conventional Changelog Action
# runs-on: ubuntu-latest id: changelog
# steps: uses: TriPSs/conventional-changelog-action@v3
# - uses: actions/checkout@v2 with:
# # This is only to get the next version number so we can set the version before compile skip-version-file: 'true'
# - name: Conventional Changelog Action skip-commit: 'true'
# id: changelog version-file: 'version.json'
# uses: TriPSs/conventional-changelog-action@v3 output-file: 'false'
# with: skip-on-empty: 'false'
# github-token: ${{ secrets.github_token }} git-push: 'false'
# skip-version-file: 'true'
# skip-commit: 'true' - name: Output version
# version-file: 'version.json' run: |
# output-file: 'false' echo "outputs: ${{ steps.changelog.outputs.tag }}"
# skip-on-empty: 'false' echo "Version: ${{ steps.changelog.outputs.version }}"
echo "log: ${{ steps.changelog.outputs.clean_changelog }}"
# - name: Output version
# run: |
# echo "outputs: ${{ steps.changelog.outputs.tag }}"
# echo "Version: ${{ steps.changelog.outputs.version }}"
# echo "log: ${{ steps.changelog.outputs.clean_changelog }}"
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build-ui ] needs: [ build-ui, versioning ]
strategy: strategy:
matrix: matrix:
include: include:
@ -120,22 +114,22 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-nuget ${{ runner.os }}-nuget
# This is only to get the next version number so we can set the version before compile # - name: Conventional Changelog Action
- name: Conventional Changelog Action # id: changelog
id: changelog # uses: TriPSs/conventional-changelog-action@v3.7.1
uses: TriPSs/conventional-changelog-action@v3 # with:
with: # github-token: ${{ secrets.WORKFLOW_PAT }}
github-token: ${{ secrets.github_token }} # git-message: 'chore(release): {version}'
skip-version-file: 'true' # version-file: 'version.json'
skip-commit: 'true' # output-file: 'CHANGELOG.md'
version-file: 'version.json' # skip-on-empty: 'false'
output-file: 'false' #env:
skip-on-empty: 'false' # ENV: 'dont-use-git'
- name: Set Backend Version - name: Set Backend Version
run: | run: |
dotnet tool install -g dotnet-setversion dotnet tool install -g dotnet-setversion
setversion -r ${{ steps.changelog.outputs.version }} setversion -r ${{ needs.versioning.outputs.version }}
working-directory: src working-directory: src
- name: Publish Backend ${{ matrix.os }} - name: Publish Backend ${{ matrix.os }}
@ -176,55 +170,63 @@ jobs:
./src/Ombi/${{ matrix.os }}.${{ matrix.format }} ./src/Ombi/${{ matrix.os }}.${{ matrix.format }}
release: release:
needs: [ publish, unit-test ] needs: [ publish, unit-test, versioning ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - 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: Download Artifacts - name: Download Artifacts
id: download id: download
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
path: artifacts path: artifacts
- name: Publish to GitHub - name: Publish to GitHub Master
uses: softprops/action-gh-release@v1
if: contains(github.ref, 'master')
with:
body: ${{ needs.versioning.outputs.changelog }}
name: ${{ needs.versioning.outputs.tag }}
tag_name: ${{ needs.versioning.outputs.tag }}
files: |
artifacts/**/*.tar.gz
artifacts/**/*.zip
- name: Publish to GitHub Develop
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') if: contains(github.ref, 'develop')
with: with:
body: ${{ steps.changelog.outputs.clean_changelog }} prerelease: true
draft: 'true' body: ${{ needs.versioning.outputs.changelog }}
name: ${{ steps.changelog.outputs.tag }} name: ${{ needs.versioning.outputs.tag }}
tag_name: ${{ steps.changelog.outputs.tag }} tag_name: ${{ needs.versioning.outputs.tag }}
files: | files: |
artifacts/**/*.tar.gz artifacts/**/*.tar.gz
artifacts/**/*.zip artifacts/**/*.zip
# - name: Publish to GitHub update-changelog:
# uses: softprops/action-gh-release@v1 needs: [ release ]
# # if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest
# with: steps:
# body: 'Test' - uses: actions/checkout@v2
# draft: 'true' - name: Conventional Changelog Action
# name: 'Test' id: changelog
# files: | uses: TriPSs/conventional-changelog-action@v3
# artifacts/**/*.tar.gz with:
# artifacts/**/*.zip version-file: 'version.json'
skip-on-empty: 'false'
git-message: 'chore(release): :rocket: {version}'
update-apt:
needs: [ release ]
runs-on: ubuntu-latest
steps:
- name: Trigger APT Build - name: Trigger APT Build
uses: fjogeleit/http-request-action@master uses: fjogeleit/http-request-action@master
with: with:
url: 'https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches' url: 'https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches'
method: 'POST' method: 'POST'
contentType: 'application/json' contentType: 'application/json'
data: "{ 'ref':'main', 'inputs': { 'version': '${{ steps.changelog.outputs.tag }}'} }" data: "{ 'ref':'main', 'inputs': { 'version': '${{ steps.changelog.outputs.tag }}'} }"
customHeaders: "{'Accept':'application/vnd.github.v3+json', 'Authorization':'Bearer ${{secrets.APT_PAT}}', 'User-Agent':'Ombi'}" customHeaders: "{'Accept':'application/vnd.github.v3+json', 'Authorization':'Bearer ${{secrets.APT_PAT}}', 'User-Agent':'Ombi'}"

@ -2,7 +2,7 @@ name: PR Build
on: on:
pull_request: pull_request:
branches: [ develop ] types: [opened, synchronize, reopened]
jobs: jobs:
build-ui: build-ui:
@ -46,19 +46,26 @@ jobs:
cd src cd src
dotnet test --logger trx --results-directory "TestResults" dotnet test --logger trx --results-directory "TestResults"
## Don't need yet analysis:
# - name: Upload dotnet test results runs-on: ubuntu-latest
# uses: actions/upload-artifact@v2 steps:
# with: - uses: actions/checkout@v2
# name: dotnet-results with:
# path: src/TestResults # Disabling shallow clone is recommended for improving relevancy of reporting
# # Use always() to always run this step to publish test results when there are test failures fetch-depth: 0
# if: ${{ always() }} - name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=ombi-app
-Dsonar.projectKey=Ombi-app_Ombi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build-ui ] needs: [ unit-test ]
strategy: strategy:
matrix: matrix:
include: include:

Loading…
Cancel
Save