forked from blue-build/legacy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ublue-os:template' into live
- Loading branch information
Showing
2 changed files
with
38 additions
and
15 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 |
---|---|---|
|
@@ -44,29 +44,48 @@ jobs: | |
# !!! | ||
|
||
steps: | ||
- name: Maximize build space | ||
uses: AdityaGarg8/remove-unwanted-software@v1 | ||
with: | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
|
||
# Checkout push-to-registry action GitHub repository | ||
- name: Checkout Push to Registry action | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check just syntax | ||
uses: ublue-os/just-action@v1 | ||
# Confirm that cosign.pub matches SIGNING_SECRET | ||
- uses: sigstore/[email protected] | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live' | ||
|
||
- name: Check SIGNING_SECRET matches cosign.pub | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live' | ||
env: | ||
COSIGN_EXPERIMENTAL: false | ||
COSIGN_PASSWORD: "" | ||
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} | ||
shell: bash | ||
run: | | ||
echo "Checking for difference between public key from SIGNING_SECRET and cosign.pub" | ||
delta=$(diff -u <(cosign public-key --key env://COSIGN_PRIVATE_KEY) cosign.pub) | ||
if [ -z "$delta" ]; then | ||
echo "cosign.pub matches SIGNING_SECRET" | ||
else | ||
echo "cosign.pub does not match SIGNING_SECRET" | ||
echo "$delta" | ||
exit 1 | ||
fi | ||
- name: Add yq (for reading recipe.yml) | ||
uses: mikefarah/[email protected].3 | ||
uses: mikefarah/[email protected].5 | ||
|
||
- name: Gather image data from recipe | ||
run: | | ||
echo "IMAGE_NAME=$(yq '.name' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV | ||
echo "IMAGE_DESCRIPTION=$(yq '.description' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV | ||
echo "IMAGE_MAJOR_VERSION=$(yq '.image-version' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV | ||
echo "BASE_IMAGE_URL=$(yq '.base-image' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV | ||
BASE_IMAGE=$(yq '.base-image' ./config/${{ matrix.recipe }}) | ||
echo "BASE_IMAGE_URL=$BASE_IMAGE" >> $GITHUB_ENV | ||
echo "BASE_IMAGE_NAME=$(echo $BASE_IMAGE | sed 's/.*\/.*\///')" >> $GITHUB_ENV | ||
- name: Verify base image | ||
uses: EyeCantCU/cosign-action/[email protected] | ||
with: | ||
containers: ${{ env.BASE_IMAGE_NAME }}:${{ env.IMAGE_MAJOR_VERSION }} | ||
|
||
- name: Get current version | ||
id: labels | ||
|
@@ -140,6 +159,13 @@ jobs: | |
with: | ||
string: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Maximize build space | ||
uses: AdityaGarg8/remove-unwanted-software@v1 | ||
with: | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
|
||
# Build image using Buildah action | ||
- name: Build Image | ||
id: build_image | ||
|
@@ -184,9 +210,6 @@ jobs: | |
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Sign container | ||
- uses: sigstore/[email protected] | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live' | ||
|
||
- name: Sign container image | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live' | ||
run: | | ||
|
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