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 04fb6c5 commit 862cc7a
Show file tree
Hide file tree
Showing 13 changed files with 148 additions and 75 deletions.
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 }}
50 changes: 25 additions & 25 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'
- 'action.yml'
- '.github/workflows/tests.yml'
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
test-project:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
with:
project: ${{ env.INPUT_PROJECT }}
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
with:
workspace: ${{ env.INPUT_WORKSPACE }}
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
with:
spm-package: ${{ env.INPUT_SPM_PACKAGE }}
Expand Down Expand Up @@ -244,9 +244,9 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
id: xcodebuild-master
id: xcodebuild-main
with:
project: ${{ env.INPUT_PROJECT }}
target: ${{ env.INPUT_TARGET }}
Expand Down Expand Up @@ -319,8 +319,8 @@ jobs:
- id: xcodebuild
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-master.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-master.outputs.executed-command }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-main.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-main.outputs.executed-command }}
LOCAL_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-local.outputs.unprocessed-command }}
LOCAL_EXECUTED_COMMAND: ${{ steps.xcodebuild-local.outputs.executed-command }}
run: |
Expand Down Expand Up @@ -415,9 +415,9 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
id: xcodebuild-master
id: xcodebuild-main
with:
workspace: ${{ env.INPUT_WORKSPACE }}
scheme: ${{ env.INPUT_SCHEME }}
Expand Down Expand Up @@ -492,8 +492,8 @@ jobs:
- id: xcodebuild
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-master.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-master.outputs.executed-command }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-main.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-main.outputs.executed-command }}
LOCAL_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-local.outputs.unprocessed-command }}
LOCAL_EXECUTED_COMMAND: ${{ steps.xcodebuild-local.outputs.executed-command }}
run: |
Expand Down Expand Up @@ -589,9 +589,9 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
id: xcodebuild-master
id: xcodebuild-main
with:
spm-package: ${{ env.INPUT_SPM_PACKAGE }}
scheme: ${{ env.INPUT_SCHEME }}
Expand Down Expand Up @@ -666,8 +666,8 @@ jobs:
- id: xcodebuild
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-master.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-master.outputs.executed-command }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-main.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-main.outputs.executed-command }}
LOCAL_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-local.outputs.unprocessed-command }}
LOCAL_EXECUTED_COMMAND: ${{ steps.xcodebuild-local.outputs.executed-command }}
run: |
Expand Down Expand Up @@ -744,9 +744,9 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
id: xcodebuild-master
id: xcodebuild-main
with:
project: ${{ env.INPUT_PROJECT }}
scheme: ${{ env.INPUT_SCHEME }}
Expand All @@ -761,8 +761,8 @@ jobs:
- id: xcodebuild
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-master.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-master.outputs.executed-command }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-main.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-main.outputs.executed-command }}
LOCAL_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-local.outputs.unprocessed-command }}
LOCAL_EXECUTED_COMMAND: ${{ steps.xcodebuild-local.outputs.executed-command }}
run: |
Expand Down Expand Up @@ -804,9 +804,9 @@ jobs:
- name: Generate action code
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/generate-action-code
- uses: sersoft-gmbh/xcodebuild-action@master
- uses: sersoft-gmbh/xcodebuild-action@main
if: ${{ github.event_name == 'push' }}
id: xcodebuild-master
id: xcodebuild-main
with:
project: ${{ env.INPUT_PROJECT }}
scheme: ${{ env.INPUT_SCHEME }}
Expand All @@ -823,8 +823,8 @@ jobs:
- id: xcodebuild
env:
EVENT_NAME: ${{ github.event_name }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-master.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-master.outputs.executed-command }}
BRANCH_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-main.outputs.unprocessed-command }}
BRANCH_EXECUTED_COMMAND: ${{ steps.xcodebuild-main.outputs.executed-command }}
LOCAL_UNPROCESSED_COMMAND: ${{ steps.xcodebuild-local.outputs.unprocessed-command }}
LOCAL_EXECUTED_COMMAND: ${{ steps.xcodebuild-local.outputs.executed-command }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ The command that was executed by this action. This will also be printed to the a

Use the following snippet when you want to run tests configured with the `MyApp` scheme inside a `MyApp` Xcode project:
```yaml
uses: sersoft-gmbh/xcodebuild-action@v2
uses: sersoft-gmbh/xcodebuild-action@v3
with:
project: MyApp.xcodeproj
scheme: MyApp
Expand Down
12 changes: 1 addition & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ inputs:
description: The output formatter to use (e.g. xcpretty, xcbeautify, ...). The xcodebuild output will be piped into this formatter.
required: false
default: 'xcpretty --color'
use-xcpretty:
description: Whether the output of xcodebuild should be forwarded to xcpretty.
required: false
default: 'false'
deprecationMessage: 'Use `output-formatter` instead.'
xcpretty-colored-output:
description: Whether xcpretty should use colored output (e.g. `xcpretty --color`).
required: false
default: 'true'
deprecationMessage: 'Use `output-formatter` instead.'
dry-run:
description: '<TEST ONLY> Whether the commands should only be composed and not actually run. Only used in test.'
required: false
Expand All @@ -131,7 +121,7 @@ outputs:
executed-command:
description: The command that was executed.
runs:
using: node16
using: node20
main: dist/index.js
branding:
color: blue
Expand Down
26 changes: 12 additions & 14 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function allArgumentStrings(args, useResolvedValue = true, escapeValue = false)
return args.flatMap(a => argumentStrings(a, useResolvedValue, escapeValue));
}
async function runXcodebuild(args, outputFormatter) {
var _a;
const xcodebuildOut = outputFormatter ? 'pipe' : process.stdout;
const xcodebuild = (0, child_process_1.spawn)('xcodebuild', allArgumentStrings(args), {
stdio: ['inherit', xcodebuildOut, process.stderr],
Expand All @@ -110,7 +109,7 @@ async function runXcodebuild(args, outputFormatter) {
const formattedOutput = (0, child_process_1.spawn)(outputFormatter.tool, allArgumentStrings(outputFormatter.args), {
stdio: ['pipe', process.stdout, process.stderr],
});
(_a = xcodebuild.stdout) === null || _a === void 0 ? void 0 : _a.pipe(formattedOutput.stdin);
xcodebuild.stdout?.pipe(formattedOutput.stdin);
finishedPromise = finishedPromise.then((xcodeCode) => new Promise((resolve, reject) => {
formattedOutput.on('error', reject);
formattedOutput.on('exit', (formattedOutputCode, formattedOutputSignal) => {
Expand All @@ -129,9 +128,8 @@ async function runXcodebuild(args, outputFormatter) {
}));
}
const exitCode = await finishedPromise;
if (exitCode != 0) {
if (exitCode != 0)
throw new Error(`Xcodebuild action failed (${exitCode})!`);
}
}
async function main() {
let xcodebuildArgs = [];
Expand All @@ -152,29 +150,29 @@ async function main() {
}
function _pushArgWithValue(name, value, opts) {
let processedValue = value;
if (opts === null || opts === void 0 ? void 0 : opts.skipEmptyValues) {
if (opts?.skipEmptyValues) {
processedValue = processedValue.trim();
if (processedValue.length <= 0)
return;
}
if (opts === null || opts === void 0 ? void 0 : opts.isPath)
if (opts?.isPath)
processedValue = path.resolve(processedValue);
_pushArg(name, { originalValue: value, resolvedValue: processedValue });
}
function _addInputArg(inputName, argName, opts) {
if (opts === null || opts === void 0 ? void 0 : opts.isList) {
if (opts?.isList) {
let values = core.getMultilineInput(inputName);
if (values)
values.forEach(value => _pushArgWithValue(argName !== null && argName !== void 0 ? argName : inputName, value, {
isPath: opts === null || opts === void 0 ? void 0 : opts.isPath,
values.forEach(value => _pushArgWithValue(argName ?? inputName, value, {
isPath: opts?.isPath,
skipEmptyValues: true,
}));
}
else {
let value = core.getInput(inputName);
if (value)
_pushArgWithValue(argName !== null && argName !== void 0 ? argName : inputName, value, {
isPath: opts === null || opts === void 0 ? void 0 : opts.isPath,
_pushArgWithValue(argName ?? inputName, value, {
isPath: opts?.isPath,
skipEmptyValues: false,
});
}
Expand All @@ -190,12 +188,12 @@ async function main() {
}
function addBoolArg(inputName, argName) {
const value = core.getInput(inputName);
if (value === null || value === void 0 ? void 0 : value.length)
_pushArgWithValue(argName !== null && argName !== void 0 ? argName : inputName, core.getBooleanInput(inputName) ? 'YES' : 'NO');
if (value?.length)
_pushArgWithValue(argName ?? inputName, core.getBooleanInput(inputName) ? 'YES' : 'NO');
}
function addFlagArg(inputName, argName) {
if (core.getInput(inputName).length && core.getBooleanInput(inputName))
_pushArg(argName !== null && argName !== void 0 ? argName : inputName);
_pushArg(argName ?? inputName);
}
if (workspace) {
_pushArgWithValue('workspace', workspace, { isPath: true });
Expand Down
73 changes: 73 additions & 0 deletions dist/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@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/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.


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.

0 comments on commit 862cc7a

Please sign in to comment.