diff --git a/.github/workflows/publish-os-image-manifest.yaml b/.github/workflows/publish-os-image-manifest.yaml new file mode 100644 index 00000000..87abce18 --- /dev/null +++ b/.github/workflows/publish-os-image-manifest.yaml @@ -0,0 +1,117 @@ +name: Publish OS Image Manifest + +on: + push: + branches: + - main + paths: + - 'deps/full-os.conf' + - 'deps/rootfs.conf' + pull_request: + branches: + - main + paths: + - .github/workflows/publish-os-image-manifest.yaml + +permissions: + contents: read + id-token: write + +jobs: + write-manifest: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + sparse-checkout: | + deps/full-os.conf + deps/rootfs.conf + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1 + with: + role-to-assume: ${{ secrets.ROLE }} + aws-region: ${{ secrets.REGION }} + role-session-name: publish-os-image-manifest-session + + - name: Install Cosign + uses: sigstore/cosign-installer@v4.1.0 + + - name: Generate manifest + shell: bash + run: | + # MacOS + source deps/full-os.conf + os_base_url="${ARTIFACT_BASE_URL}" + arm64_url="${os_base_url}/${AARCH64_ARTIFACT}" + arm64_digest="sha512:${AARCH64_512_DIGEST}" + amd64_url="${os_base_url}/${X86_64_ARTIFACT}" + amd64_digest="sha512:${X86_64_512_DIGEST}" + + # Windows + source deps/rootfs.conf + rootfs_url="${ARTIFACT_BASE_URL}/${X86_64_ARTIFACT_PATHING}/${X86_64_ARTIFACT}" + rootfs_digest="sha512:${X86_64_512_DIGEST}" + + # Publish date is today; expiry is 6 months out. + published_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)" + expires_at="$(date -u -d '+6 months' +%Y-%m-%dT%H:%M:%SZ)" + + cat > manifest.json <