diff --git a/.github/actions/golang/action.yaml b/.github/actions/golang/action.yaml index 38841c5..e9e3a80 100644 --- a/.github/actions/golang/action.yaml +++ b/.github/actions/golang/action.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: setup-go description: "Setup Go binary and caching" diff --git a/.github/actions/install-uds-cli/action.yaml b/.github/actions/install-uds-cli/action.yaml index d74a398..f84189a 100644 --- a/.github/actions/install-uds-cli/action.yaml +++ b/.github/actions/install-uds-cli/action.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Install UDS CLI description: installs uds-cli @@ -11,11 +14,11 @@ inputs: runs: using: composite steps: - - name: Set UDS Releaser Arch - id: setUdsCliArch - shell: bash - run: INPUT=${{ runner.arch == 'X64' && 'amd64' || runner.arch }}; echo "ARCH=${INPUT,,}" >> "$GITHUB_OUTPUT" + - name: Set UDS Releaser Arch + id: setUdsCliArch + shell: bash + run: INPUT=${{ runner.arch == 'X64' && 'amd64' || runner.arch }}; echo "ARCH=${INPUT,,}" >> "$GITHUB_OUTPUT" - - name: Install UDS CLI - shell: bash - run: curl -o /usr/local/bin/uds -L https://github.com/defenseunicorns/uds-cli/releases/download/v${{ inputs.udsCliVersion }}/uds-cli_v${{ inputs.udsCliVersion }}_Linux_${{steps.setUdsCliArch.outputs.ARCH}} && chmod +x /usr/local/bin/uds + - name: Install UDS CLI + shell: bash + run: curl -o /usr/local/bin/uds -L https://github.com/defenseunicorns/uds-cli/releases/download/v${{ inputs.udsCliVersion }}/uds-cli_v${{ inputs.udsCliVersion }}_Linux_${{steps.setUdsCliArch.outputs.ARCH}} && chmod +x /usr/local/bin/uds diff --git a/.github/codeql.yaml b/.github/codeql.yaml index 71c4bdf..475d82e 100644 --- a/.github/codeql.yaml +++ b/.github/codeql.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + paths-ignore: - build/** diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..ec99165 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,52 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + +name: Lint + +on: + # This workflow is triggered on pull requests to the main branch. + pull_request: + # milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow). + types: [milestoned, opened, reopened, synchronize] + +# Permissions for the GITHUB_TOKEN used by the workflow. +permissions: + contents: read # Allows reading the content of the repository. + +jobs: + run: + runs-on: ubuntu-latest + permissions: + contents: read # Allows reading the repo contents + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Install UDS CLI + uses: defenseunicorns/setup-uds@b987a32bac3baeb67bfb08f5e1544e2f9076ee8a # v1.0.0 + with: + # renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver + version: v0.18.0 + + - name: Install lint deps + run: | + uds run lint:deps --no-progress + + - name: Lint YAML + run: | + uds run lint:yaml --no-progress + + - name: Lint Scripts + run: | + uds run lint:shell --no-progress + + - name: Lint Tasks + run: | + uds run lint:tasks --no-progress + + - name: Lint License + run: | + uds run lint:license --no-progress diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 26e1313..7b8f30d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Release UDS-CLI on Tag permissions: diff --git a/.github/workflows/scan-codeql.yaml b/.github/workflows/scan-codeql.yaml index 2442295..d5c5671 100644 --- a/.github/workflows/scan-codeql.yaml +++ b/.github/workflows/scan-codeql.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Analyze CodeQL permissions: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6bb32b1..7b696c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + name: Run tests permissions: @@ -35,9 +38,9 @@ jobs: - name: Build UDS Releaser run: uds run build-cli-linux-amd - + - name: Run e2e tests run: uds run e2e - + - name: Run unit tests run: uds run unit diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 64d002f..05c9d2c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + before: hooks: - go mod tidy diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..d9c87df --- /dev/null +++ b/.yamllint @@ -0,0 +1,32 @@ +yaml-files: + - '**/*.y*ml' + - '.yamllint' + +rules: + anchors: enable + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + float-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning diff --git a/CODEOWNERS b/CODEOWNERS index 0df7d4a..49c5362 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,4 +2,4 @@ # Additional privileged files /CODEOWNERS @jeff-mccoy @daveworth -/LICENSE @jeff-mccoy @austenbryan +/LICENS* @jeff-mccoy @austenbryan diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/LICENSING.md b/LICENSING.md new file mode 100644 index 0000000..a439b77 --- /dev/null +++ b/LICENSING.md @@ -0,0 +1,18 @@ +# Dual Licensing + +This software is licensed under either of: + +- GNU Affero General Public License v3.0 (AGPLv3), see [LICENSE.md](./LICENSE.md) +- Defense Unicorns Commercial License, see below + +## Defense Unicorns Commercial License + +The use of this software under a commercial license is subject to the individual +terms of the license agreement between the licensee and Defense Unicorns. The +content of this license depends on the specific agreement and may vary. For +more information about obtaining a commercial license, please contact +Defense Unicorns at [defenseunicorns.com](https://defenseunicorns.com). + +To use this software under the commercial license, you must have a valid license +agreement with Defense Unicorns. The terms of the Defense Unicorns, Inc. license +agreement supplant and supersede the terms of the AGPL v3 license. diff --git a/main.go b/main.go index 56313c4..035770b 100644 --- a/main.go +++ b/main.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package main import "github.com/defenseunicorns/uds-releaser/src/cmd" diff --git a/src/cmd/check.go b/src/cmd/check.go index fe080e7..0f19802 100644 --- a/src/cmd/check.go +++ b/src/cmd/check.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( diff --git a/src/cmd/release.go b/src/cmd/release.go index a29a77e..72f85f5 100644 --- a/src/cmd/release.go +++ b/src/cmd/release.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( diff --git a/src/cmd/root.go b/src/cmd/root.go index 8f3525b..1d59ee6 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( diff --git a/src/cmd/show.go b/src/cmd/show.go index 5a36e50..bb43ba9 100644 --- a/src/cmd/show.go +++ b/src/cmd/show.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( diff --git a/src/cmd/update-yaml.go b/src/cmd/update-yaml.go index 8d71668..8c8d476 100644 --- a/src/cmd/update-yaml.go +++ b/src/cmd/update-yaml.go @@ -1,18 +1,6 @@ -/* -Copyright © 2024 Defense Unicorns +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ package cmd import ( diff --git a/src/platforms/github/release.go b/src/platforms/github/release.go index 20e84b1..c8f9762 100644 --- a/src/platforms/github/release.go +++ b/src/platforms/github/release.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package github import ( diff --git a/src/platforms/github/release_test.go b/src/platforms/github/release_test.go index 3da028c..6f976fd 100644 --- a/src/platforms/github/release_test.go +++ b/src/platforms/github/release_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package github import ( diff --git a/src/platforms/gitlab/release.go b/src/platforms/gitlab/release.go index 35578ca..0693ee7 100644 --- a/src/platforms/gitlab/release.go +++ b/src/platforms/gitlab/release.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package gitlab import ( diff --git a/src/platforms/gitlab/release_test.go b/src/platforms/gitlab/release_test.go index 8bcdf73..7a56fc8 100644 --- a/src/platforms/gitlab/release_test.go +++ b/src/platforms/gitlab/release_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package gitlab import ( diff --git a/src/platforms/platform.go b/src/platforms/platform.go index 27b1ffb..b3ead6c 100644 --- a/src/platforms/platform.go +++ b/src/platforms/platform.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package platforms import ( diff --git a/src/test/common.go b/src/test/common.go index 01c279a..1ab354c 100644 --- a/src/test/common.go +++ b/src/test/common.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package test import ( diff --git a/src/test/e2e/00_show_test.go b/src/test/e2e/00_show_test.go index c6e9152..a2e618b 100644 --- a/src/test/e2e/00_show_test.go +++ b/src/test/e2e/00_show_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package test import ( diff --git a/src/test/e2e/01_check_test.go b/src/test/e2e/01_check_test.go index 90d5962..3b948c6 100644 --- a/src/test/e2e/01_check_test.go +++ b/src/test/e2e/01_check_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package test import ( diff --git a/src/test/e2e/02_update-yaml_test.go b/src/test/e2e/02_update-yaml_test.go index 1ab2bb1..b787a2c 100644 --- a/src/test/e2e/02_update-yaml_test.go +++ b/src/test/e2e/02_update-yaml_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package test import ( diff --git a/src/test/e2e/main_test.go b/src/test/e2e/main_test.go index 0dd07a4..990d2a3 100644 --- a/src/test/e2e/main_test.go +++ b/src/test/e2e/main_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package test import ( diff --git a/src/test/releaser.yaml b/src/test/releaser.yaml index 792c81d..dcdc245 100644 --- a/src/test/releaser.yaml +++ b/src/test/releaser.yaml @@ -1,3 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + flavors: - name: base version: "1.0.0-uds.0" diff --git a/src/types/config.go b/src/types/config.go index 59a4d1a..4a306c8 100644 --- a/src/types/config.go +++ b/src/types/config.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package types type Flavor struct { diff --git a/src/utils/config.go b/src/utils/config.go index c32d2c1..e2b436b 100644 --- a/src/utils/config.go +++ b/src/utils/config.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package utils import ( diff --git a/src/utils/git.go b/src/utils/git.go index 9027d0b..5d690a4 100644 --- a/src/utils/git.go +++ b/src/utils/git.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package utils import ( diff --git a/src/utils/yaml.go b/src/utils/yaml.go index eb28597..f8bcefa 100644 --- a/src/utils/yaml.go +++ b/src/utils/yaml.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package utils import ( diff --git a/src/utils/zarf.go b/src/utils/zarf.go index df58c65..fead95a 100644 --- a/src/utils/zarf.go +++ b/src/utils/zarf.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package utils import ( diff --git a/src/version/yaml.go b/src/version/yaml.go index 04beb9a..ab9db98 100644 --- a/src/version/yaml.go +++ b/src/version/yaml.go @@ -1,3 +1,6 @@ +// Copyright 2024 Defense Unicorns +// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + package version import ( diff --git a/tasks.yaml b/tasks.yaml index ac194d6..325339e 100644 --- a/tasks.yaml +++ b/tasks.yaml @@ -1,16 +1,8 @@ -# Copyright © 2024 Defense Unicorns -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + +includes: + - lint: https://raw.githubusercontent.com/defenseunicorns/uds-common/v1.2.2/tasks/lint.yaml tasks: # build tasks @@ -53,4 +45,6 @@ tasks: - name: unit description: run all unit tests actions: - - cmd: go test $(go list ./... | grep -v test) -failfast -v -timeout 5m + - cmd: | + # shellcheck disable=SC2046 + go test $(go list ./... | grep -v test) -failfast -v -timeout 5m