-
Notifications
You must be signed in to change notification settings - Fork 11
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
7 changed files
with
230 additions
and
98 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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Nightly Release | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' ## Every day at midnight UTC | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: checkout | ||
steps: | ||
- name: Run tests | ||
uses: ./.github/workflows/release-tests.yaml | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
needs: test | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup golang | ||
uses: ./.github/actions/golang | ||
|
||
- name: Install tools | ||
uses: ./.github/actions/install-tools | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: build-artifacts | ||
path: build/ | ||
|
||
- name: Create tag | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
with: | ||
# try to create a tag, if it already exists, update it | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/nightly', | ||
sha: context.sha | ||
}).catch(err => { | ||
if (err.status !== 422) throw err; | ||
github.rest.git.updateRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'tags/nightly', | ||
sha: context.sha | ||
}); | ||
}) | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean --verbose --config .goreleaser-nightly.yaml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} |
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
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: E2E Tests | ||
on: | ||
workflow_call: # This is the event that triggers the workflow | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/parallel-tests.yaml | ||
|
||
test-ghcr: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: build-artifacts | ||
path: build/ | ||
|
||
- name: setup-using-previous-job | ||
uses: ./.github/actions/setup-from-previous | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run GHCR tests | ||
run: | | ||
build/uds run test:e2e-ghcr | ||
env: | ||
GITHUB_TOKEN: secrets.GITHUB_TOKEN | ||
|
||
- name: Save logs | ||
if: always() | ||
uses: defenseunicorns/uds-common/.github/actions/save-logs@172a905901cb9bd76d096d2850bf31af5c5a4fa1 # v0.8.0 | ||
with: | ||
suffix: test-ghcr | ||
|
||
|
||
smoke-test: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
# Checkout the repo and setup the tooling for this job | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: build-artifacts | ||
path: build/ | ||
|
||
- name: Setup golang | ||
uses: ./.github/actions/golang | ||
|
||
- name: Make UDS-CLI executable | ||
run: | | ||
chmod +x build/uds | ||
- name: Setup K3d | ||
uses: ./.github/actions/k3d | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run UDS Core smoke test | ||
run: build/uds run test:ci-uds-core-smoke-test | ||
shell: bash | ||
|
||
- name: Save logs | ||
if: always() | ||
uses: defenseunicorns/uds-common/.github/actions/save-logs@172a905901cb9bd76d096d2850bf31af5c5a4fa1 # v0.8.0 | ||
with: | ||
suffix: smoke-test |
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
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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
# Build a universal macOS binary | ||
universal_binaries: | ||
- replace: false | ||
|
||
# Build the different combination of goos/arch binaries | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
ldflags: | ||
- -s -w -X 'github.com/defenseunicorns/uds-cli/src/config.CLIVersion={{.Tag}}' -X 'github.com/defenseunicorns/zarf/src/config.ActionsCommandZarfPrefix=zarf' | ||
- -X 'github.com/defenseunicorns/zarf/src/config.ActionsCommandZarfPrefix=zarf' | ||
- -X 'github.com/derailed/k9s/cmd.version=${K9S_VERSION}' | ||
- -X 'github.com/google/go-containerregistry/cmd/crane/cmd.Version=${CRANE_VERSION}' | ||
- -X 'github.com/defenseunicorns/zarf/src/cmd/tools.syftVersion=${SYFT_VERSION}' | ||
- -X 'github.com/defenseunicorns/zarf/src/cmd/tools.archiverVersion=${ARCHIVER_VERSION}' | ||
- -X 'github.com/defenseunicorns/zarf/src/cmd/tools.helmVersion=${HELM_VERSION}' | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
binary: uds | ||
|
||
# Save the built artifacts as binaries (instead of wrapping them in a tarball) | ||
archives: | ||
- format: binary | ||
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}" | ||
|
||
# generate a sha256 checksum of all release artifacts | ||
checksum: | ||
name_template: "checksums.txt" | ||
algorithm: sha256 | ||
|
||
# generate sboms for each binary artifact | ||
sboms: | ||
- artifacts: binary | ||
documents: | ||
- "sbom_{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}.sbom" | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-snapshot" | ||
|
||
# Use the auto-generated changelog github provides | ||
changelog: | ||
use: github-native | ||
|
||
# Generate a GitHub release and publish the release for the tag | ||
release: | ||
github: | ||
owner: defenseunicorns | ||
name: uds-cli | ||
prerelease: auto | ||
mode: append | ||
draft: false |
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