Skip to content

Commit cde0c42

Browse files
committed
Push to metadata all at one
1 parent 0e02b89 commit cde0c42

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

.github/workflows/CI.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,40 @@ jobs:
6868
env:
6969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070

71+
Publish:
72+
needs: [ISO]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: 'Checkout Repo'
76+
uses: actions/checkout@v6
77+
78+
- name: Generate Tag
79+
id: tag
80+
run: |
81+
VER=$(egrep ^KERNEL_VERSION build.sh|cut -d= -f2)
82+
REL=$(egrep ^PKGREL build.sh|cut -d= -f2)
83+
echo Version is ${VER}-${REL}
84+
echo "kver=${VER}" >> $GITHUB_ENV
85+
echo "isotag=${VER}-${REL}" >> $GITHUB_ENV
7186
- name: Update the json
7287
if: github.ref == 'refs/heads/mainline'
88+
id: publish
7389
run: |
7490
git clone https://github.com/t2linux/wiki.git
7591
cd wiki/docs/tools
7692
93+
for i in ubuntu kubuntu
94+
do
95+
wget https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/sha256-${i}-25.10
96+
SHA256=$(cat ./sha256-${i} | cut -d " " -f 1)
97+
rm sha256-${i}-25.10
98+
CAPS=$(echo "${i}" | tr '_-' ' ' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2); print}')
7799
cat << EOF > update.py
78100
import json
79101
# Define the new links
80-
new_link1 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${{ matrix.target.image }}-25.10-${{ env.kver }}-t2-questing.iso.00"
81-
new_link2 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${{ matrix.target.image }}-25.10-${{ env.kver }}-t2-questing.iso.01"
82-
new_link3 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${{ matrix.target.image }}-25.10-${{ env.kver }}-t2-questing.iso.02"
102+
new_link1 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${i}-25.10-${{ env.kver }}-t2-questing.iso.00"
103+
new_link2 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${i}-25.10-${{ env.kver }}-t2-questing.iso.01"
104+
new_link3 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/${i}-25.10-${{ env.kver }}-t2-questing.iso.02"
83105
# Load the JSON file
84106
with open('distro-metadata.json', 'r') as file:
85107
data = json.load(file)
@@ -90,7 +112,7 @@ jobs:
90112
distro['iso'] = new_links
91113
distro['sha256'] = sha256
92114
# Update the links
93-
update_links(data['all'], "${{ env.caps }} 25.10 - Questing Quokka", [new_link1, new_link2, new_link3], "${{ env.sha256 }}")
115+
update_links(data['all'], "${CAPS} 25.10 - Questing Quokka", [new_link1, new_link2, new_link3], "${SHA256}")
94116
# Save the updated JSON back to the file
95117
with open('distro-metadata.json', 'w') as file:
96118
json.dump(data, file, indent=2)
@@ -99,9 +121,9 @@ jobs:
99121
100122
python3 update.py
101123
rm update.py
124+
done
102125
cd -
103-
104-
- name: Push updated links to t2linux.org
126+
- name: Push changes to apt repo
105127
if: github.ref == 'refs/heads/mainline'
106128
uses: cpina/github-action-push-to-another-repository@main
107129
env:
@@ -113,4 +135,4 @@ jobs:
113135
user-email: github-actions[bot]@users.noreply.github.com
114136
user-name: github-actions[bot]
115137
target-branch: master
116-
commit-message: Distro metadata - Update ${{ env.caps }} 25.10 to v${{ env.isotag }}
138+
commit-message: Distro metadata - Update Ubuntu 25.10 and its flavours to v${{ env.isotag }}

0 commit comments

Comments
 (0)