-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3536 from makhov/binary-sign
Signing k0s binaries with cosign
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 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 |
---|---|---|
|
@@ -85,6 +85,20 @@ jobs: | |
name: logs | ||
path: tests/*.log | ||
|
||
- name: Sign binary | ||
env: | ||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
run: | | ||
echo $COSIGN_KEY | base64 -d > cosign.key | ||
docker run --rm \ | ||
-v "$(CURDIR):/k0s" \ | ||
gcr.io/projectsigstore/cosign:v2.2.0 \ | ||
sign-blob \ | ||
--key /k0s/cosign.key \ | ||
--tlog-upload=false \ | ||
/k0s/k0s --output-file /k0s/k0s.sig | ||
- name: Upload Release Assets - Binary | ||
id: upload-release-asset | ||
uses: shogo82148/[email protected] | ||
|
@@ -94,6 +108,15 @@ jobs: | |
asset_name: k0s-${{ needs.release.outputs.tag_name }}-amd64 | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - Signature | ||
id: upload-release-asset | ||
uses: shogo82148/[email protected] | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./k0s.sig | ||
asset_name: k0s-${{ needs.release.outputs.tag_name }}-amd64.sig | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Artifact for use in other Jobs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -145,6 +168,20 @@ jobs: | |
env: | ||
VERSION: ${{ needs.release.outputs.tag_name }} | ||
|
||
- name: Sign binary | ||
env: | ||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
run: | | ||
echo $COSIGN_KEY | base64 -d > cosign.key | ||
docker run --rm \ | ||
-v "$(CURDIR):/k0s" \ | ||
gcr.io/projectsigstore/cosign:v2.2.0 \ | ||
sign-blob \ | ||
--key /k0s/cosign.key \ | ||
--tlog-upload=false \ | ||
/k0s/k0s.exe --output-file /k0s/k0s.exe.sig | ||
- name: Clean Docker | ||
run: | | ||
docker system prune --all --volumes --force | ||
|
@@ -158,6 +195,15 @@ jobs: | |
asset_name: k0s-${{ needs.release.outputs.tag_name }}-amd64.exe | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - Signature | ||
id: upload-release-asset | ||
uses: shogo82148/[email protected] | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./k0s.exe.sig | ||
asset_name: k0s-${{ needs.release.outputs.tag_name }}-amd64.exe.sig | ||
asset_content_type: application/octet-stream | ||
|
||
# https://github.com/actions/checkout/issues/273#issuecomment-642908752 | ||
# Golang mod cache tends to set directories to read-only, which breaks any | ||
# attempts to simply remove those directories. The `make clean-gocache` | ||
|
@@ -196,6 +242,20 @@ jobs: | |
env: | ||
VERSION: ${{ needs.release.outputs.tag_name }} | ||
|
||
- name: Sign binary | ||
env: | ||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
run: | | ||
echo $COSIGN_KEY | base64 -d > cosign.key | ||
docker run --rm \ | ||
-v "$(CURDIR):/k0s" \ | ||
gcr.io/projectsigstore/cosign:v2.2.0 \ | ||
sign-blob \ | ||
--key /k0s/cosign.key \ | ||
--tlog-upload=false \ | ||
/k0s/k0s --output-file /k0s/k0s.sig | ||
- name: Set up Go for smoke tests | ||
uses: actions/setup-go@v3 | ||
with: | ||
|
@@ -223,6 +283,15 @@ jobs: | |
asset_name: k0s-${{ needs.release.outputs.tag_name }}-arm64 | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - Signature | ||
id: upload-release-asset | ||
uses: shogo82148/[email protected] | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./k0s.sig | ||
asset_name: k0s-${{ needs.release.outputs.tag_name }}-arm64.sig | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Artifact for use in other Jobs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|
@@ -277,6 +346,20 @@ jobs: | |
env: | ||
VERSION: ${{ needs.release.outputs.tag_name }} | ||
|
||
- name: Sign binary | ||
env: | ||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }} | ||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | ||
run: | | ||
echo $COSIGN_KEY | base64 -d > cosign.key | ||
docker run --rm \ | ||
-v "$(CURDIR):/k0s" \ | ||
gcr.io/projectsigstore/cosign:v2.2.0 \ | ||
sign-blob \ | ||
--key /k0s/cosign.key \ | ||
--tlog-upload=false \ | ||
/k0s/k0s --output-file /k0s/k0s.sig | ||
# Need to install Go manually: https://github.com/actions/setup-go/issues/106 | ||
- name: Set up Go for smoke tests (armv6l) | ||
run: | | ||
|
@@ -317,6 +400,15 @@ jobs: | |
asset_name: k0s-${{ needs.release.outputs.tag_name }}-arm | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Release Assets - Signature | ||
id: upload-release-asset | ||
uses: shogo82148/[email protected] | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./k0s.sig | ||
asset_name: k0s-${{ needs.release.outputs.tag_name }}-arm.sig | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Artifact for use in other Jobs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
|