Skip to content

Commit

Permalink
Merge pull request #25 from defenseunicorns/fix-license
Browse files Browse the repository at this point in the history
chore: add linting for license SPDX headers
  • Loading branch information
Racer159 authored Oct 31, 2024
2 parents 61a4ad1 + 18a4c43 commit 5c794d4
Show file tree
Hide file tree
Showing 36 changed files with 204 additions and 108 deletions.
3 changes: 3 additions & 0 deletions .github/actions/golang/action.yaml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
17 changes: 10 additions & 7 deletions .github/actions/install-uds-cli/action.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
3 changes: 3 additions & 0 deletions .github/codeql.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

paths-ignore:
- build/**

Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/scan-codeql.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 32 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Additional privileged files
/CODEOWNERS @jeff-mccoy @daveworth
/LICENSE @jeff-mccoy @austenbryan
/LICENS* @jeff-mccoy @austenbryan
File renamed without changes.
18 changes: 18 additions & 0 deletions LICENSING.md
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 2 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
16 changes: 2 additions & 14 deletions src/cmd/check.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
16 changes: 2 additions & 14 deletions src/cmd/release.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
16 changes: 2 additions & 14 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
16 changes: 2 additions & 14 deletions src/cmd/show.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
16 changes: 2 additions & 14 deletions src/cmd/update-yaml.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
3 changes: 3 additions & 0 deletions src/platforms/github/release.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package github

import (
Expand Down
3 changes: 3 additions & 0 deletions src/platforms/github/release_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package github

import (
Expand Down
3 changes: 3 additions & 0 deletions src/platforms/gitlab/release.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package gitlab

import (
Expand Down
3 changes: 3 additions & 0 deletions src/platforms/gitlab/release_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package gitlab

import (
Expand Down
3 changes: 3 additions & 0 deletions src/platforms/platform.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package platforms

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package test

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/e2e/00_show_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package test

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/e2e/01_check_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package test

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/e2e/02_update-yaml_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package test

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/e2e/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2024 Defense Unicorns
// SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial

package test

import (
Expand Down
3 changes: 3 additions & 0 deletions src/test/releaser.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading

0 comments on commit 5c794d4

Please sign in to comment.