-
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
2 changed files
with
154 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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Release UDS-CLI on Tag | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
# Checkout the repo and setup the tooling for this job | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup golang | ||
uses: ./.github/actions/golang | ||
|
||
- name: Build CLI | ||
run: | | ||
make build-cli-linux-amd | ||
# Upload the contents of the build directory for later stages to use | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | ||
with: | ||
name: build-artifacts | ||
path: build/ | ||
retention-days: 1 | ||
|
||
validate: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
# Checkout the repo and setup the tooling for this job | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
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: Install Zarf | ||
uses: ./.github/actions/zarf | ||
|
||
- name: Run e2e tests | ||
run: | | ||
make test-e2e ARCH=amd64 | ||
- name: Save logs | ||
if: always() | ||
uses: ./.github/actions/save-logs | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
needs: validate | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup golang | ||
uses: ./.github/actions/golang | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: build-artifacts | ||
path: build/ | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist --debug | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
# 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 changlog 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: true |