diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 47063593..c10a0d75 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -8,11 +8,14 @@ jobs: runs-on: ubuntu-latest name: Kodi addon checker steps: + - name: Checkout uses: actions/checkout@v4 + - name: Kodi addon checker validation id: kodi-addon-checker - uses: xbmc/action-kodi-addon-checker@v1.2 + uses: zim514/action-kodi-addon-checker@latest + #uses: xbmc/action-kodi-addon-checker@v1.2 with: kodi-version: matrix addon-id: ${{ github.event.repository.name }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad2d5472..fdbf3c41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,96 +6,81 @@ on: - v* jobs: - kodi-addon-checker: + release: runs-on: ubuntu-latest - name: Kodi addon checker + name: Release addon if: github.repository == 'zim514/script.service.hue' + steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Kodi addon checker validation - id: kodi-addon-checker - uses: xbmc/action-kodi-addon-checker@v1.2 + - name: Checkout addon + uses: actions/checkout@v4 with: - kodi-version: matrix - addon-id: ${{ github.event.repository.name }} + path: 'addon' - repo_update: - name: Update Kodi Dev Repo - if: github.repository == 'zim514/script.service.hue' - runs-on: ubuntu-latest - needs: kodi-addon-checker - - steps: - name: Checkout repo uses: actions/checkout@v4 with: + path: 'repo' repository: 'zim514/zim514.github.io' - token: ${{secrets.ACTIONS_TOKEN}} + token: ${{secrets.GITHUB_TOKEN}} - - name: Set up Python ${{ matrix.python-version }} + - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' + cache: 'pip' - name: Install dependencies - run: pip install gitpython - - - name: Generate repo run: | - git rm -rf *.md5 *.zip - ./create_repository.py --datadir=docs/repo https://github.com/zim514/script.service.hue.git:script.service.hue https://github.com/zim514/zim514.github.io.git:repository.snapcase - working-directory: ./ - - - name: Commit - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: Automated repo update ${{ github.ref_name }} - add_options: '--all' - - release: - name: Build and release addon - if: github.repository == 'zim514/script.service.hue' - runs-on: ubuntu-latest - needs: kodi-addon-checker + python -m pip install --upgrade pip + pip install kodi-addon-checker gitpython - steps: + - name: Kodi addon checker validation + id: kodi-addon-check + run: kodi-addon-checker --branch=matrix ./addon/script.service.hue - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" + - name: Clean & Generate repo + run: | + git --git-dir=./repo/.git/ --work-tree=./repo/ rm -rf --ignore-unmatch *.md5 *.zip + echo "pwd: $(pwd)" + ./repo/create_repository.py --datadir=repo/docs/repo ./addon/script.service.hue ./repo/repository.snapcase - - name: Install dependencies + - name: Output debug + shell: bash run: | - pip install pipenv - pip install git+https://github.com/xbmc/kodi-addon-submitter.git - pipenv install --dev + echo "****************************************" + find . -name .git -prune -o -print - - name: Build zip - id: build_zip + - name : Find addon zip + id: zip_filename run: | - pipenv run submit-addon -z -s script.service.hue - ls *.zip - echo "zip_filename=$(ls *.zip)" >> $GITHUB_ENV + file=$(find . -type f -name "script.service.hue-*.zip") + echo "File: $file" + echo "::set-output name=zip_filename::$file" - name: Create Github Release id: create_release - uses: ncipollo/release-action@v1 + uses: ncipollo/release-action@v1.13.0 with: allowUpdates: true - artifacts: "${{ env.zip_filename }}" + artifacts: "${{ steps.zip_filename.outputs.zip_filename }}" artifactContentType: application/zip + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Automated repo update ${{ github.ref_name }} + repository: ./repo + add_options: '--all' + + rollbar: name: Notify deploy to Rollbar if: github.repository == 'zim514/script.service.hue' runs-on: ubuntu-latest - needs: [ release, repo_update ] + needs: [ release ] steps: - name: Notify deploy to Rollbar diff --git a/.gitignore b/.gitignore index 3f2eb927..6e90e562 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,8 @@ # pycharm /.idea /venv + + +#workflow testing +workflow.env +act-ref.json \ No newline at end of file diff --git a/workflow.env b/workflow.env new file mode 100644 index 00000000..e69de29b