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

feat: more stable license checker and additional dual licenses #156

Merged
merged 7 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
17 changes: 15 additions & 2 deletions authors/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(shell uname -m)
ifeq ($(ARCH),x86_64)
ARCH=amd64
else ifeq ($(ARCH),arm64)
ARCH=arm64
else ifeq ($(ARCH),aarch64)
ARCH=arm64
else ifeq ($(ARCH),i386)
ARCH=386
else ifeq ($(ARCH),i686)
ARCH=386
endif

format: .bin/shfmt
echo formatting source code ...
.bin/shfmt --write .
Expand All @@ -16,9 +30,8 @@ test: .bin/shellcheck .bin/shfmt # runs all automated tests
touch .bin/shellcheck # update the timestamp so that Make doesn't re-install Shellcheck each time it runs

.bin/shfmt: Makefile
echo installing Shellfmt ...
mkdir -p .bin
curl -sSL https://github.com/mvdan/sh/releases/download/v3.5.1/shfmt_v3.5.1_linux_amd64 -o .bin/shfmt
curl -sSL https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_$(OS)_$(ARCH) -o .bin/shfmt
chmod +x .bin/shfmt

.SILENT:
17 changes: 15 additions & 2 deletions changelog/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(shell uname -m)
ifeq ($(ARCH),x86_64)
ARCH=amd64
else ifeq ($(ARCH),arm64)
ARCH=arm64
else ifeq ($(ARCH),aarch64)
ARCH=arm64
else ifeq ($(ARCH),i386)
ARCH=386
else ifeq ($(ARCH),i686)
ARCH=386
endif

format: .bin/shfmt .bin/ory node_modules # formats the source code
echo formatting source code ...
.bin/ory dev headers copyright --type=open-source
Expand Down Expand Up @@ -26,9 +40,8 @@ test: .bin/shellcheck .bin/shfmt # runs all automated tests
touch .bin/shellcheck # update the timestamp so that Make doesn't re-install Shellcheck each time it runs

.bin/shfmt: Makefile
echo installing Shellfmt ...
mkdir -p .bin
curl -sSL https://github.com/mvdan/sh/releases/download/v3.5.1/shfmt_v3.5.1_linux_amd64 -o .bin/shfmt
curl -sSL https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_$(OS)_$(ARCH) -o .bin/shfmt
chmod +x .bin/shfmt

node_modules: package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion changelog/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
curl -sSfL https://raw.githubusercontent.com/ory/ci/master/changelog/create_changelog.sh | bash
shell: bash
- name: commit the changes
if: ${{ github.ref_name == 'master' || github.ref_type == 'tag' }}
if: ${{ github.ref_name == "master" || github.ref_type == "tag" }}
env:
GITHUB_TOKEN: ${{ inputs.token || github.token }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions licenses/check/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Check license compliance'
name: "Check license compliance"
runs:
using: 'composite'
using: "composite"
steps:
- name: Install license scanner
run:
Expand Down
3 changes: 3 additions & 0 deletions licenses/license-engine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ALLOWED_LICENSES=(
'(AFL-2.1 OR BSD-3-Clause)'
'Apache 2.0'
'Apache-2.0'
'(Apache-2.0 OR MPL-1.1)'
'Apache-2.0 AND MIT'
'Apache License, Version 2.0'
'Apache*'
'Artistic-2.0'
Expand Down Expand Up @@ -38,6 +40,7 @@ ALLOWED_LICENSES=(
'(MIT OR Apache-2.0)'
'(MIT OR CC0-1.0)'
'(MIT OR GPL-2.0)'
'(MIT AND CC-BY-3.0)'
aeneasr marked this conversation as resolved.
Show resolved Hide resolved
'MPL-2.0'
'(MPL-2.0 OR Apache-2.0)'
'Public Domain'
Expand Down
8 changes: 6 additions & 2 deletions licenses/list-licenses
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ set -e

# list Node licenses
if [ -f package.json ]; then
npm exec --yes license-checker -- --csv --excludePrivatePackages --customPath .bin/license-template-node.json
{ echo; } 2>/dev/null
if grep -q '"dependencies":\s+{[^}]*"[^"]+":' package.json; then
npm exec --yes license-checker -- --production --csv --excludePrivatePackages --customPath .bin/license-template-node.json
{ echo; } 2>/dev/null
else
echo "No dependencies found in package.json" >&2
fi
fi

# list Go licenses
Expand Down
8 changes: 4 additions & 4 deletions licenses/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: 'Setup license checker'
name: "Setup license checker"
input:
token:
description: Personal access token
required: false

runs:
using: 'composite'
using: "composite"
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -15,10 +15,10 @@ runs:
token: ${{ inputs.token || github.token }}
- uses: actions/setup-go@v3
with:
go-version: '1.23'
go-version: "1.23"
- uses: actions/setup-node@v2
with:
node-version: '22'
node-version: "22"
- name: Install license scanner
run:
curl https://raw.githubusercontent.com/ory/ci/master/licenses/install |
Expand Down
10 changes: 5 additions & 5 deletions licenses/write/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Generate license overview'
description: 'List and check licenses'
name: "Generate license overview"
description: "List and check licenses"

runs:
using: 'composite'
using: "composite"
steps:
- name: List and write licenses
run: |
Expand All @@ -14,6 +14,6 @@ runs:
if: ${{ inputs.write_if_match }}
uses: EndBug/[email protected]
with:
message: 'autogen(docs): update milestone document'
message: "autogen(docs): update milestone document"
author_name: ory-bot
author_email: '[email protected]'
author_email: "[email protected]"
Loading