-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ jobs: | |
needs: [linux] | ||
if: github.event_name == 'push' || inputs.Docker | ||
steps: | ||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@v3 | ||
|
||
- name: Log In to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
|
@@ -82,6 +85,8 @@ jobs: | |
echo "GHCR_DIGEST_SHA=$(cat GHCR_DIGEST_SHA)" | tee -a "${GITHUB_ENV}" | ||
docker buildx imagetools inspect --format '{{json .Manifest}}' index.docker.io/${{github.repository}}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json) | jq -r '.digest' > DOCKERHUB_DIGEST_SHA | ||
echo "DOCKERHUB_DIGEST_SHA=$(cat DOCKERHUB_DIGEST_SHA)" | tee -a "${GITHUB_ENV}" | ||
cosign sign --yes $(jq --arg GHCR_DIGEST_SHA "$(cat GHCR_DIGEST_SHA)" -cr '.target."docker-metadata-action".tags | map(select(startswith("ghcr.io/${{github.repository}}")) | . + "@" + $GHCR_DIGEST_SHA) | join(" ")' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json) | ||
cosign sign --yes $(jq --arg DOCKERHUB_DIGEST_SHA "$(cat DOCKERHUB_DIGEST_SHA)" -cr '.target."docker-metadata-action".tags | map(select(startswith("index.docker.io/${{github.repository}}")) | . + "@" + $DOCKERHUB_DIGEST_SHA) | join(" ")' ${{ runner.temp }}/${{matrix.variant}}/bake-meta.json) | ||
- name: Attest GHCR | ||
uses: actions/attest-build-provenance@v2 | ||
|
@@ -334,7 +339,7 @@ jobs: | |
run: | | ||
rustup target add ${{matrix.target}} | ||
# Get latest FoundationDB installer | ||
curl -Lo foundationdb.pkg "https://glare.now.sh/apple/foundationdb/${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}.pkg" | ||
curl --retry 5 -Lso foundationdb.pkg "$(curl --retry 5 -Ls 'https://api.github.com/repos/apple/foundationdb/releases' | jq -r '.[] | select(.prerelease == false) | .assets[] | select(.name | test("${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}" + ".pkg")) | .browser_download_url' | head -n1)" | ||
sudo installer -allowUntrusted -dumplog -pkg foundationdb.pkg -target / | ||
cargo build --release --target ${{matrix.target}} -p mail-server --no-default-features --features "foundationdb elastic s3 redis enterprise" | ||
mkdir -p artifacts | ||
|
@@ -405,16 +410,25 @@ jobs: | |
archive/**/*.tar.gz | ||
archive/**/*.zip | ||
- name: Use cosign to sign existing artifacts | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: | | ||
archive/**/*.tar.gz | ||
archive/**/*.zip | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
archive/**/*.tar.gz | ||
archive/**/*.zip | ||
archive/**/*.sigstore.json | ||
prerelease: ${{!startsWith(github.ref, 'refs/tags/') || null}} | ||
tag_name: ${{!startsWith(github.ref, 'refs/tags/') && 'nightly' || null}} | ||
append_body: true | ||
# TODO add instructions about using cosign to verify binary artifact | ||
body: | | ||
<hr /> | ||
## Check binary attestation at [here](${{ steps.attest.outputs.attestation-url }}) | ||
### Check binary attestation at [here](${{ steps.attest.outputs.attestation-url }}) |