Repository navigation
79 lines (68 loc) · 2.53 KB
/
Copy pathsubmit-release.yml
File metadata and controls
79 lines (68 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Submit Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
ref:
description: 'Tag to submit (e.g. v3.0.3)'
required: true
jobs:
release:
if: github.repository == 'anxdpanic/script.module.python.twitch'
name: Submit Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.11" ]
steps:
- name: Checkout Add-on
uses: actions/checkout@v4
with:
path: ${{ github.event.repository.name }}
ref: ${{ inputs.ref || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libxml2-utils xmlstarlet
python -m pip install --upgrade pip
python -m pip install git+https://github.com/xbmc/kodi-addon-submitter.git
- name: Configure git
run: |
git config --global user.name "anxdpanic"
git config --global user.email "anxdpanic@users.noreply.github.com"
- name: Remove Unwanted Files
run: |
mv .git ..
rm -rf .??*
mv ../.git .
rm *.md
git add .
git commit -m "Remove unwanted files"
working-directory: ${{ github.event.repository.name }}
- name: Check fork push access
run: |
echo "token length: ${#GH_TOKEN}"
case "$GH_TOKEN" in *[[:space:]]*) echo "::error::token contains whitespace";; esac
curl -sS -o /dev/null -D - -H "Authorization: token $GH_TOKEN" https://api.github.com/user | grep -iE '^(HTTP|x-oauth-scopes|github-authentication-token-expiration)' || true
tmp=$(mktemp -d) && cd "$tmp"
git init -q && git commit -q --allow-empty -m probe
git push --dry-run "https://$GH_USERNAME:$GH_TOKEN@github.com/$GH_USERNAME/repo-scripts.git" HEAD:refs/heads/push-access-probe
env:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
- name: Submit to Official Repository (Nexus)
id: submit-nexus
run: |
submit-addon -r repo-scripts -b nexus --pull-request ${{ github.event.repository.name }}
working-directory: ${{ github.event.repository.name }}
env:
GH_USERNAME: anxdpanic
GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }}
EMAIL: anxdpanic@users.noreply.github.com