Skip to content

Commit

Permalink
Merge release/1.0.0 into master
Browse files Browse the repository at this point in the history
Merge release/1.0.0 into master
Merge pull request #9 from chrisism/release/1.0.0
  • Loading branch information
chrisism authored Jan 19, 2022
2 parents 6d2cfb9 + 02fa0e6 commit d8157c5
Show file tree
Hide file tree
Showing 284 changed files with 1,464 additions and 19,619 deletions.
221 changes: 221 additions & 0 deletions .build/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# Azure Devops Pipeline definition
#
# Will build and release packages on Gitflow branch triggers (main, release/*).
# In build phase it will apply semver versioning with help of GitVersion (plugin needed).
# The results of the build are stored in a package on Azure Devops.
# After the build phase the deployment phase follows. During this phase it will checkout the
# github repository containing a Kodi addon repository and add the new package so users can
# download it.
# There are 2 deployment phases, first one for staging where only beta/release candidates are
# deployed. Second one is the main repository for official releases (based on master/main branch).
#
# Needed extensions:
# - GitTools / GitVersion
# - RegEx Match & Replace
#
# Needed variables (var groups in library)
# - repository.variables
# - git_emailAddress
# - git_userName
# - github_token
trigger:
- master
- release/*
- dev

pool:
vmImage: 'ubuntu-latest'

variables:
isMaster: or(${{eq(variables['Build.SourceBranch'], 'refs/heads/master')}},${{eq(variables['Build.SourceBranch'], 'refs/heads/main')}})
isReleaseCandidate: ${{startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')}}
isHotfix: ${{startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')}}
isDev: ${{eq(variables['Build.SourceBranch'], 'refs/heads/dev')}}
workingDirectory: '$(Build.SourcesDirectory)'
addonName: plugin.program.akl

stages:
- stage: Build
displayName: Build stage
jobs:
- job: build
displayName: build

steps:
- task: gitversion/setup@0
displayName: 'Install GitTools'
inputs:
versionSpec: '5.3.x'

- task: gitversion/execute@0
displayName: 'Executing gitversion'

- script: |
echo '##vso[task.setvariable variable=packageVersion]$(GitVersion.LegacySemVer)
echo '##vso[task.setvariable variable=projectVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
displayName: 'Setting version variables'
condition: not(eq(${{variables.isMaster}}, true))
- script: |
echo '##vso[task.setvariable variable=packageVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
echo '##vso[task.setvariable variable=projectVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
displayName: 'Setting version variables'
condition: eq(${{variables.isMaster}}, true)
- task: UsePythonVersion@0
displayName: 'Use Python 3.x'

- task: PipAuthenticate@0
displayName: Authenticate with artifact feed
inputs:
artifactFeeds: AKL/akl_libs

- bash: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: pip install
- task: RegExMatchReplace@2
displayName: 'Set addon version'
inputs:
PathToFile: 'addon.xml'
RegEx: 'version="\d+\.\d+\.\d+.*" provider'
ValueToReplace: 'version="$(packageVersion)" provider'

- bash: update_addon_news $(workingDirectory)/addon.xml $(workingDirectory)/changelog.txt
displayName: 'Add changelog in addon.xml'
workingDirectory: '$(workingDirectory)'

- bash: 'python -m pytest --junitxml=$(build.artifactstagingdirectory)/$(addonName)_$(packageVersion)_testresults.xml'
workingDirectory: '$(workingDirectory)'
displayName: 'Run tests'

- task: CopyFiles@2
displayName: 'Copy addon files for package'
inputs:
SourceFolder: ''
Contents: |
*.py
*.md
*.xml
*.txt
resources/**/*.*
media/**/*.*
!requirements.txt
!**/*.pyc
!**/__pycache__/**/*.*
TargetFolder: '$(build.artifactstagingdirectory)/$(addonName)/'
CleanTargetFolder: true
flattenFolders: false
OverWrite: true

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(build.artifactstagingdirectory)/$(addonName)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(build.artifactstagingdirectory)/package/$(addonName)-$(packageVersion).zip'
replaceExistingArchive: true

- task: CopyFiles@2
displayName: 'Copy addon files for repository'
inputs:
SourceFolder: '$(build.artifactstagingdirectory)/$(addonName)/'
Contents: |
addon.xml
media/*.*
TargetFolder: '$(build.artifactstagingdirectory)/package/'
CleanTargetFolder: false
flattenFolders: false
OverWrite: true

- script: md5sum $(addonName)-$(packageVersion).zip > $(addonName)-$(packageVersion).zip.md5
workingDirectory: $(build.artifactstagingdirectory)/package/
displayName: 'Creating md5 file for zipfile'

- script: md5sum addon.xml > addon.xml.md5
workingDirectory: $(build.artifactstagingdirectory)/package/
displayName: 'Creating md5 file for addonxml'

- task: PublishBuildArtifacts@1
displayName: 'Publishing application as artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/package/'
ArtifactName: '$(addonName)'
publishLocation: 'Container'

- task: PublishTestResults@2
displayName: 'Publish test result'
inputs:
testResultsFiles: '$(build.artifactstagingdirectory)/$(addonName)_$(packageVersion)_testresults.xml'
testRunTitle: $(addonName)_$(packageVersion)
condition: succeededOrFailed()

- task: GithubRelease@1
displayName: 'Create GitHub Release'
condition: and(succeeded(), eq(${{variables.isMaster}}, true))
inputs:
gitHubConnection: 'github.com_chrisism'
repositoryName: chrisism/$(addonName)
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: $(packageVersion)
title: $(Build.BuildNumber)
releaseNotesSource: filePath
releaseNotesFilePath: $(workingDirectory)/release.md
addChangeLog: true
assets: |
$(build.artifactstagingdirectory)/package/*.*
$(workingDirectory)/changelog.txt
- stage: DeployStaging
displayName: Deployment on Staging
condition: and(succeeded(), or(eq(${{variables.isReleaseCandidate}}, true),eq(${{variables.isHotfix}}, true),eq(${{variables.isMaster}}, true)))
jobs:
- deployment: Staging
environment:
name: Staging

variables:
- group: repository.variables
- name: repository_url
value: github.com/chrisism/repository.chrisism.dev.git
- name: repository_name
value: repository.chrisism.dev
- name: repository_data_dir
value: 'matrix'
- name: branchName
value: main

strategy:
runOnce:
deploy:
steps:
- template: publish_in_repository_steps.yml

- stage: DeployProd
displayName: Deployment on Production
condition: and(succeeded(), eq(${{variables.isMaster}}, true))
jobs:
- deployment: Production
environment:
name: Production

variables:
- group: repository.variables
- name: repository_url
value: github.com/chrisism/repository.chrisism.git
- name: repository_name
value: repository.chrisism
- name: repository_data_dir
value: 'matrix'
- name: branchName
value: master

strategy:
runOnce:
deploy:
steps:
- template: publish_in_repository_steps.yml
61 changes: 61 additions & 0 deletions .build/publish_in_repository_steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Azure Devops Pipeline template
#
# This pipeline template part defines the deployment or publishing
# of the addon in a kodi repository build in github.
#
steps:
- download: current
displayName: 'Downloading addon artifact'

- script: |
git clone https://$(repository_url)
workingDirectory: $(Pipeline.Workspace)/
displayName: 'Clone git repository'
- script: |
git config user.email $(git_emailAddress)
git config user.name $(git_userName)
workingDirectory: $(Pipeline.Workspace)/$(repository_name)
displayName: 'Configure git settings'
- task: UsePythonVersion@0
displayName: 'Use Python 3.x'

- task: PipAuthenticate@0
displayName: Authenticate with artifact feed
inputs:
artifactFeeds: AKL/akl_libs

- bash: |
python -m pip install --upgrade pip
pip install kodi.tools
displayName: pip install
- task: CopyFiles@2
displayName: 'Copy addon into git repository'
inputs:
SourceFolder: '$(Pipeline.Workspace)/$(addonName)'
Contents: '**/*.*'
TargetFolder: '$(Pipeline.Workspace)/$(repository_name)/$(repository_data_dir)/$(addonName)'
CleanTargetFolder: false
flattenFolders: false
OverWrite: true

- bash: merge_addon_xml $(addonName) $(Pipeline.Workspace)/$(repository_name)/$(repository_data_dir)/addons.xml $(Pipeline.Workspace)/$(repository_name)/$(repository_data_dir)/$(addonName)/addon.xml
displayName: 'Merge addon xml files for repository'
workingDirectory: '$(Pipeline.Workspace)/$(repository_name)/$(repository_data_dir)/'

- script: md5sum addons.xml > addons.xml.md5
workingDirectory: $(Pipeline.Workspace)/$(repository_name)/$(repository_data_dir)/
displayName: 'Creating md5 file for addons.xml'

- script: |
git add .
git commit -m "$(Build.DefinitionName) Release $(Build.BuildNumber)"
workingDirectory: $(Pipeline.Workspace)/$(repository_name)/
displayName: 'Git - Add and commit'
- script: |
git push https://$(github_token)@$(repository_url) $(branchName)
workingDirectory: $(Pipeline.Workspace)/$(repository_name)/
displayName: 'Git - Push'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.pyo
*.pyc

.venv/
# Ignore installation directory
plugin.program.AEL

Expand Down
8 changes: 7 additions & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Advanced Emulator Launcher #
## Advanced Kodi Launcher

**Advanced Kodi Launcher** was another (friendly) fork from Advanced Emulator Launcher
version 0.10.0 in 2020 by [Chrisism](mailto:[email protected]).
AKL closely follows AEL, but focusses on being more modulair and being able to support
different types of launcher applications.


Advanced Emulator Launcher was originally forked from Advanced Launcher
version 2.5.8 on May 2016 by Wintermute0110 <[email protected]>. First
Expand Down
37 changes: 37 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
continuous-delivery-fallback-tag: unstable
commit-message-incrementing: enabled
branches:
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: unstable
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
master:
regex: (master|main)
mode: ContinuousDeployment
tag: "stable"
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
hotfix:
regex: hotfix(es)?[/-]
mode: ContinuousDeployment
tag: useBranchName
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: true
release:
regex: releases?[/-]
mode: ContinuousDeployment
tag: rc
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
feature:
regex: features?[/-]
mode: ContinuousDeployment

merge-message-formats:
devops: '(M|m)erge (?<SourceBranch>.+) (in)?to (?<TargetBranch>.+)'
Loading

0 comments on commit d8157c5

Please sign in to comment.