Skip to content

Commit

Permalink
Rename primary branch to main, use node20, update tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Sep 17, 2023
1 parent 99a53ca commit b658d54
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 38 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/actions/generate-action-code/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
check-latest: true
cache: 'npm'
- name: Generate action code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: CodeQL

on:
push:
branches: [ master ]
branches: [ main ]
paths-ignore: [ 'dist/*.js' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ main ]
schedule:
- cron: '15 11 * * 1'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy Action Code

on:
push:
branches: [ master ]
branches: [ main ]
paths-ignore: [ 'dist/*.js' ]

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
update-tags:
name: Update Running Releases
runs-on: ubuntu-latest
if: ${{ github.event.release.prerelease == false }}
steps:
- uses: actions/checkout@v4
- uses: sersoft-gmbh/running-release-tags-action@v2
if: ${{ github.event.release.prerelease == false }}
- uses: sersoft-gmbh/running-release-tags-action@v3
with:
update-full-release: true
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Tests

on:
push:
branches: [ master ]
branches: [ main ]
paths:
- 'dist/*.js'
- '.github/actions/generate-action-code/**'
- '.github/workflows/tests.yml'
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
test-spm:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/swifty-docs-action@master
- uses: sersoft-gmbh/swifty-docs-action@main
if: ${{ github.event_name == 'push' }}
with:
package-path: ${{ env.INPUT_PACKAGE_PATH }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/swifty-docs-action@master
- uses: sersoft-gmbh/swifty-docs-action@main
if: ${{ github.event_name == 'push' }}
with:
package-path: ${{ env.INPUT_PACKAGE_PATH }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This action generates documentation for a Swift package using `docc`.

**Important:** The package must use the [Swift-DocC Plugin](https://github.com/apple/swift-docc-plugin) unless `xcodebuild` is used!

**Note:** Version 2 of this action replaced `jazzy` with `docc`! Use `@v1` to use `jazzy`.
**Note:** As of version 2, this action uses `docc` instead of `jazzy`! Use `@v1` to use `jazzy`.

## Inputs

Expand Down Expand Up @@ -73,7 +73,7 @@ The path to the output directory.

Use the following snippet in a Swift package repository to generate documentation for all products of your Swift package:
```yaml
uses: sersoft-gmbh/swifty-docs-action@v2
uses: sersoft-gmbh/swifty-docs-action@v3
with:
output: docs
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ inputs:
description: The path to the output folder.
required: false
runs:
using: node16
using: node20
main: dist/index.js
branding:
color: orange
Expand Down
7 changes: 3 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(186));
const exec = __importStar(__nccwpck_require__(514));
const exec_1 = __nccwpck_require__(514);
const path_1 = __importDefault(__nccwpck_require__(17));
async function runCmd(cmd, args, cwd) {
const output = await exec.getExecOutput(cmd, args, {
const output = await (0, exec_1.getExecOutput)(cmd, args, {
cwd: cwd,
silent: !core.isDebug(),
});
Expand Down Expand Up @@ -73,9 +73,8 @@ async function generateDocsUsingSPM(packagePath, targets, options) {
if (options.outputPath)
args.push('--allow-writing-to-directory', options.outputPath);
args.push('generate-documentation');
if (targets.length > 0) {
if (targets.length > 0)
args.push(...targets.flatMap(t => ['--target', t]));
}
args.push(...docCFlags(options, true));
return await runCmd('swift', args, packagePath);
}
Expand Down
97 changes: 97 additions & 0 deletions dist/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@actions/core
MIT
The MIT License (MIT)

Copyright 2019 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@actions/exec
MIT
The MIT License (MIT)

Copyright 2019 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@actions/http-client
MIT
Actions Http Client for Node.js

Copyright (c) GitHub, Inc.

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


@actions/io
MIT
The MIT License (MIT)

Copyright 2019 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tunnel
MIT
The MIT License (MIT)

Copyright (c) 2012 Koichi Kobayashi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


uuid
MIT
The MIT License (MIT)

Copyright (c) 2010-2020 Robert Kieffer and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 changes: 16 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "swifty-docs-action",
"version": "2.0.0",
"version": "3.0.0",
"description": "A GitHub action generates the documentation for all products of a Swift package using docc.",
"main": "dist/index.js",
"engines": {
"node": ">=20"
},
"exports": {
".": "./dist/index.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc",
"pack": "rm -rf dist && ncc build lib/main.js -o dist"
"pack": "rm -rf dist && ncc build lib/main.js -o dist --license license.txt --target es2022"
},
"repository": {
"type": "git",
Expand All @@ -27,7 +32,8 @@
"@actions/exec": "^1.1.1"
},
"devDependencies": {
"@types/node": "^16.18.50",
"@tsconfig/node20": "^20.1.2",
"@types/node": "^20.6.2",
"@vercel/ncc": "^0.38.0",
"typescript": "^5.2.2"
}
Expand Down
8 changes: 3 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import { getExecOutput } from '@actions/exec';
import path from 'path';

interface ILengthProviding {
Expand All @@ -17,7 +17,7 @@ interface IDocCOptions {
}

async function runCmd(cmd: string, args?: string[], cwd?: string): Promise<string> {
const output = await exec.getExecOutput(cmd, args, {
const output = await getExecOutput(cmd, args, {
cwd: cwd,
silent: !core.isDebug(),
});
Expand Down Expand Up @@ -49,9 +49,7 @@ async function generateDocsUsingSPM(packagePath: string, targets: string[], opti
let args = ['package'];
if (options.outputPath) args.push('--allow-writing-to-directory', options.outputPath);
args.push('generate-documentation');
if (targets.length > 0) {
args.push(...targets.flatMap(t => ['--target', t]));
}
if (targets.length > 0) args.push(...targets.flatMap(t => ['--target', t]));
args.push(...docCFlags(options, true));
return await runCmd('swift', args, packagePath);
}
Expand Down
9 changes: 3 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"target": "ES2019",
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true
"outDir": "lib",
"rootDir": "src"
},
"include": ["src/**/*"]
}

0 comments on commit b658d54

Please sign in to comment.