Skip to content

Commit cc21e30

Browse files
committed
Add sha256 to json
1 parent 8d1fd25 commit cc21e30

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/CI.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
chmod +x ${{ github.workspace }}/build_in_docker.sh
3333
${{ github.workspace }}/build_in_docker.sh kubuntu
3434
35+
- name: print sha256sum
36+
run: |
37+
cat ${{ github.workspace }}/output/sha256*
38+
SHA256=$(cat ${{ github.workspace }}/output/sha256* | cut -d " " -f 1)
39+
echo "sha256=${SHA256}" >> $GITHUB_ENV
40+
3541
- name: Upload package artifact
3642
uses: actions/upload-artifact@v4
3743
with:
@@ -69,12 +75,13 @@ jobs:
6975
with open('distro-metadata.json', 'r') as file:
7076
data = json.load(file)
7177
# Function to update the links
72-
def update_links(distros, name, new_links):
78+
def update_links(distros, name, new_links, sha256):
7379
for distro in distros:
7480
if distro['name'] == name:
7581
distro['iso'] = new_links
82+
distro['sha256'] = sha256
7683
# Update the links
77-
update_links(data['all'], "Kubuntu 25.10 - Questing Quokka", [new_link1, new_link2, new_link3])
84+
update_links(data['all'], "Kubuntu 25.10 - Questing Quokka", [new_link1, new_link2, new_link3], "${{ env.sha256 }}")
7885
# Save the updated JSON back to the file
7986
with open('distro-metadata.json', 'w') as file:
8087
json.dump(data, file, indent=2)
@@ -125,6 +132,12 @@ jobs:
125132
chmod +x ${{ github.workspace }}/build_in_docker.sh
126133
${{ github.workspace }}/build_in_docker.sh ubuntu-unity
127134
135+
- name: print sha256sum
136+
run: |
137+
cat ${{ github.workspace }}/output/sha256*
138+
SHA256=$(cat ${{ github.workspace }}/output/sha256* | cut -d " " -f 1)
139+
echo "sha256=${SHA256}" >> $GITHUB_ENV
140+
128141
- name: Upload package artifact
129142
uses: actions/upload-artifact@v4
130143
with:
@@ -162,12 +175,13 @@ jobs:
162175
with open('distro-metadata.json', 'r') as file:
163176
data = json.load(file)
164177
# Function to update the links
165-
def update_links(distros, name, new_links):
178+
def update_links(distros, name, new_links, sha256):
166179
for distro in distros:
167180
if distro['name'] == name:
168181
distro['iso'] = new_links
182+
distro['sha256'] = sha256
169183
# Update the links
170-
update_links(data['all'], "Ubuntu Unity 25.10 - Questing Quokka", [new_link1, new_link2, new_link3])
184+
update_links(data['all'], "Ubuntu Unity 25.10 - Questing Quokka", [new_link1, new_link2, new_link3], "${{ env.sha256 }}")
171185
# Save the updated JSON back to the file
172186
with open('distro-metadata.json', 'w') as file:
173187
json.dump(data, file, indent=2)

0 commit comments

Comments
 (0)