Skip to content

Commit a301558

Browse files
feat: Add workflow to update windows hash and filename (#446)
Signed-off-by: Shubharanshu Mahapatra <[email protected]>
1 parent 8d6ecb7 commit a301558

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/rootfs.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
# More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
1414
id-token: write
1515
contents: write
16+
pull-requests: write
1617

1718
jobs:
1819
build-rootfs-image:
@@ -65,12 +66,35 @@ jobs:
6566
6667
compressed_archive=finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz
6768
gzip -9 -c finch-rootfs-production-${{ matrix.arch }}.tar > $compressed_archive
68-
sha512sum $compressed_archive | cut -d " " -f 1 > $compressed_archive.sha512sum
69+
sha512_digest=$(sha512sum $compressed_archive | cut -d " " -f 1)
70+
echo $sha512_digest > $compressed_archive.sha512sum
6971
7072
ARCHPATH="x86-64"
73+
ARTIFACT_KEY="X86_64"
7174
if [ ${{ matrix.arch }} == "arm64" ]; then
7275
ARCHPATH="aarch64"
76+
ARTIFACT_KEY="ARM64"
7377
fi
7478
7579
# Upload tarball and shasum to S3
7680
aws s3 cp . s3://${{ secrets.DEPENDENCY_BUCKET_NAME }}/${{ matrix.platform }}/$ARCHPATH/ --recursive --exclude "*" --include "finch-rootfs-production-${{ matrix.arch }}-"$TIMESTAMP".tar.gz*"
81+
82+
cat <<EOL > deps/rootfs.conf
83+
ARTIFACT_BASE_URL=https://deps.runfinch.com
84+
85+
${ARTIFACT_KEY}_ARTIFACT_PATHING=common/$ARCHPATH
86+
${ARTIFACT_KEY}_ARTIFACT=$compressed_archive
87+
${ARTIFACT_KEY}_512_DIGEST=$sha512_digest
88+
EOL
89+
90+
- name: create pr
91+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
92+
with:
93+
token: ${{ secrets.GITHUB_TOKEN }}
94+
signoff: true
95+
branch: create-rootfs-${{ matrix.arch }}-${{ steps.timestamp.outputs.value }}
96+
delete-branch: true
97+
title: 'build(deps): Update windows rootfs'
98+
add-paths: deps/rootfs.conf
99+
body: |
100+
Update the rootfs for the windows platform.

0 commit comments

Comments
 (0)