Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Workflow For Publishing Application Packages to GHCR #1856

Merged
merged 29 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5580380
add version to the dos-games example
YrrepNoj Jun 27, 2023
7e9236e
add workflow for publishing the dos-games package to GHCR
YrrepNoj Jun 27, 2023
9eed4cd
Merge branch 'main' into 758-publish-example-packages
Racer159 Jun 27, 2023
0dd0587
update dos games verion to 1.0.0
YrrepNoj Jun 28, 2023
6c276ff
Merge branch 'main' into 758-publish-example-packages
YrrepNoj Jun 28, 2023
431e8f9
Merge branch 'main' into 758-publish-example-packages
YrrepNoj Jun 28, 2023
df73613
Merge branch 'main' into 758-publish-example-packages
YrrepNoj Jun 29, 2023
95f2252
Merge branch 'main' into 758-publish-example-packages
Racer159 Jun 30, 2023
9c88aa9
update workflow for publishing packages
YrrepNoj Jun 30, 2023
cd59bf4
Merge branch 'main' into 758-publish-example-packages
Racer159 Jul 2, 2023
111219b
add warnings about depercating sget functionality within Zarf
YrrepNoj Jul 3, 2023
58a3b23
add permissions to the package publishing workflow
YrrepNoj Jul 11, 2023
2a91eab
add depreication notice to the 'CosignKeyPath' field description with…
YrrepNoj Jul 11, 2023
1c43f3e
update docs and schema
YrrepNoj Jul 11, 2023
721e26e
Merge branch 'main' into 758-publish-example-packages
YrrepNoj Jul 11, 2023
24cc1fa
update docs and schema
YrrepNoj Jul 11, 2023
82da0e9
Merge branch 'main' into 758-publish-example-packages
Racer159 Jul 22, 2023
25cc874
use kms key to sign packages that are created during every release
YrrepNoj Jul 24, 2023
a094d3f
update docs and schema
YrrepNoj Jul 24, 2023
490e0fd
Update docs/2-the-zarf-cli/100-cli-commands/zarf_package_deploy.md
YrrepNoj Jul 24, 2023
207177a
remove unnecessary nodejs import for publish workflow
YrrepNoj Jul 24, 2023
1b599c3
update deprecation warning and update docs and schema
YrrepNoj Jul 24, 2023
49024ec
update deprecation warning and update a TODO comment
YrrepNoj Jul 24, 2023
c6433ab
update docs and schema
YrrepNoj Jul 24, 2023
cd974e6
publish the release applications to the 'packages' sub namespace
YrrepNoj Jul 24, 2023
a3ab42f
reduce flux overrides for the helm controler in the bigbang extension
YrrepNoj Jul 24, 2023
e7069ca
Merge branch 'main' into 758-publish-example-packages
Racer159 Jul 27, 2023
b73f515
Merge branch 'main' into 758-publish-example-packages
Racer159 Jul 27, 2023
f6df16b
revert that change where we reduced flux overrides for the helm contr…
YrrepNoj Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish-application-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Zarf Injector Rust Binaries
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved

permissions:
contents: read

on:
workflow_dispatch:
inputs:
branchName:
description: "Branch to build the injector from"
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved
required: true

jobs:
build-injector:
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.event.inputs.branchName }}

- name: Setup golang
uses: ./.github/actions/golang

YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup NodeJS
uses: ./.github/actions/node
Racer159 marked this conversation as resolved.
Show resolved Hide resolved

- name: Build CLI
run: |
make build-cli-linux-amd
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved

- name: "Login to GHCR"
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: dummy
password: ${{ github.token }}

- name: Build And Publish Application Packages
# TODO: Add package signing to this step
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved
run: |
make build-application-packages
make publish-application-packages
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,21 @@ init-package: ## Create the zarf init package (must `brew install coreutils` on
release-init-package:
$(ZARF_BIN) package create -o build -a $(ARCH) --set AGENT_IMAGE_TAG=$(AGENT_IMAGE_TAG) --confirm .

# INTERNAL used to build the dos games packages for release
build-release-packages:
$(ZARF_BIN) package create -o build -a amd64 examples/dos-game --confirm
$(ZARF_BIN) package create -o build -a arm64 examples/dos-game --confirm
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved


# INTERNAL used to publish the dos games packages to GHCR
publish-release-packages:
$(ZARF_BIN) package publish ./build/zarf-package-dos-games-amd64-0.0.1.tar.zst oci://ghcr.io/defenseunicorns/zarf-package/dos-games
$(ZARF_BIN) package publish ./build/zarf-package-dos-games-arm64-0.0.1.tar.zst oci://ghcr.io/defenseunicorns/zarf-package/dos-games

build-examples: ## Build all of the example packages
@test -s $(ZARF_BIN) || $(MAKE) build-cli

@test -s ./build/zarf-package-dos-games-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/dos-games -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-dos-games-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/dos-games -o build -a $(ARCH) --confirm
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved

@test -s ./build/zarf-package-manifests-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/manifests -o build -a $(ARCH) --confirm

Expand Down Expand Up @@ -186,7 +197,7 @@ test-ui-dev-server:

.PHONY: test-ui-build-server
# INTERNAL: used to start the built version of the API server for the Zarf Web UI (in CI)
test-ui-build-server:
test-ui-build-server:
API_PORT=3333 API_TOKEN=insecure $(ZARF_BIN) dev ui

# INTERNAL: used to test that a dev has ran `make docs-and-schema` in their PR
Expand Down
1 change: 1 addition & 0 deletions examples/dos-games/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kind: ZarfPackageConfig
metadata:
name: dos-games
description: Simple example to load classic DOS games into K8s in the airgap
version: 0.0.1

components:
- name: baseline
Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/06_create_sbom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestCreateSBOM(t *testing.T) {
cachePath := filepath.Join(tmpdir, ".cache-location")
sbomPath := filepath.Join(tmpdir, ".sbom-location")

pkgName := fmt.Sprintf("zarf-package-dos-games-%s.tar.zst", e2e.Arch)
pkgName := fmt.Sprintf("zarf-package-dos-games-%s-0.0.1.tar.zst", e2e.Arch)

stdOut, stdErr, err := e2e.Zarf("package", "create", "examples/dos-games", "--zarf-cache", cachePath, "--sbom-out", sbomPath, "--confirm")
require.NoError(t, err, stdOut, stdErr)
Expand Down
4 changes: 2 additions & 2 deletions src/test/e2e/25_helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func testHelmEscaping(t *testing.T) {
func testHelmUninstallRollback(t *testing.T) {
t.Log("E2E: Helm Uninstall and Rollback")

goodPath := fmt.Sprintf("build/zarf-package-dos-games-%s.tar.zst", e2e.Arch)
goodPath := fmt.Sprintf("build/zarf-package-dos-games-%s-0.0.1.tar.zst", e2e.Arch)
evilPath := fmt.Sprintf("zarf-package-dos-games-%s.tar.zst", e2e.Arch)

// Create the evil package (with the bad configmap).
Expand Down Expand Up @@ -127,7 +127,7 @@ func testHelmUninstallRollback(t *testing.T) {
func testHelmAdoption(t *testing.T) {
t.Log("E2E: Helm Adopt a Deployment")

packagePath := fmt.Sprintf("build/zarf-package-dos-games-%s.tar.zst", e2e.Arch)
packagePath := fmt.Sprintf("build/zarf-package-dos-games-%s-0.0.1.tar.zst", e2e.Arch)
deploymentManifest := "src/test/packages/25-manifest-adoption/deployment.yaml"

// Deploy dos-games manually into the cluster without Zarf
Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/26_simple_packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestDosGames(t *testing.T) {
t.Log("E2E: Dos games")
e2e.SetupWithCluster(t)

path := fmt.Sprintf("build/zarf-package-dos-games-%s.tar.zst", e2e.Arch)
path := fmt.Sprintf("build/zarf-package-dos-games-%s-0.0.1.tar.zst", e2e.Arch)

// Deploy the game
stdOut, stdErr, err := e2e.Zarf("package", "deploy", path, "--confirm")
Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/32_checksum_and_signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestChecksumAndSignature(t *testing.T) {
e2e.SetupWithCluster(t)

testPackageDirPath := "examples/dos-games"
pkgName := fmt.Sprintf("zarf-package-dos-games-%s.tar.zst", e2e.Arch)
pkgName := fmt.Sprintf("zarf-package-dos-games-%s-0.0.1.tar.zst", e2e.Arch)
privateKeyFlag := "--key=src/test/packages/zarf-test.prv-key"
publicKeyFlag := "--key=src/test/packages/zarf-test.pub"

Expand Down