Skip to content

Commit

Permalink
Initial squash
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmoro authored and stoyicker committed May 23, 2024
1 parent 1e15176 commit ba6a1ec
Show file tree
Hide file tree
Showing 116 changed files with 3,771 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 100
6 changes: 6 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Be reasonable and respectful. This repository, discussions within and artifacts derived from it are
freely available, but it is still expected that you act within reasonable boundaries, whether you
are a source contributor or not.

The owners reserve the right to impose temporary and/or permanent restrictions against particular
users on this repository as well as any others under the same ownership if deemed necessary.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Bug Report
description: Report a bug in the project
body:
- type: markdown
attributes:
value: |
**Please include:**
* Clear reproduction steps.
* Frequency with which the steps above reproduce the bug (if not 100%).
* Expected result(s) of the reproduction steps, as well as the actual ones.
Detailed reports are more likely to be addressed faster.
- type: textarea
attributes:
label: Description
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Feature request
description: Request new functionality
body:
- type: textarea
attributes:
label: Description
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Question
description: If you have any doubts, just ask
body:
- type: textarea
attributes:
label: Description
validations:
required: true
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/vulnerability.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Security vulnerability
description: Report a vulnerability on any versions of the tool
body:
- type: textarea
attributes:
label: Description
validations:
required: true
- type: textarea
attributes:
label: What versions is this vulnerability observed on?
validations:
required: true
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
No pre-defined structure is enforced, but descriptive PRs are likely to be
attended earlier.
4 changes: 4 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Report vulnerabilities as vulnerability-type issues.

Find vulnerabilities as [issues with the `vulnerability` label](
https://github.com/tidal-music/network-time/issues?q=is%3Aissue+is%3Aopen+label%3Avulnerability).
20 changes: 20 additions & 0 deletions .github/actions/runGradleTask/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup Gradle and run a task on all modules that have it
description: Includes setting up JDK
inputs:
task:
description: The task to run
required: true
preTaskString:
description: A String to pass to the Gradle invocation before the task. This can be used for example to pass properties
required: false
default: ""
runs:
using: composite
steps:
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: gradle
- run: ./gradlew ${{ inputs.preTaskString }} ${{ inputs.task }}
shell: bash
42 changes: 42 additions & 0 deletions .github/actions/submitDependencyReport/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Submit dependencies
description: Generates a GitHub-ready dependency report for the given module and submits it
inputs:
module:
description: The target module
required: true
github-token:
description: The value of GITHUB_TOKEN
required: true
runs:
using: composite
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: gradle
- run: .scripts/dependency_report_generate.sh -m ${{ inputs.module }} -c allSourceSetsCompileDependenciesMetadata > dependencies_${{ inputs.module }}_raw
shell: bash
- run: .scripts/github/dependency_report_as_github_json.sh -i dependencies_${{ inputs.module }}_raw -n ${{ inputs.module }} -s $(TZ=UTC date +"%Y-%m-%dT%H:%M:%SZ") -l ${{ inputs.module }}/build.gradle.kts > dependencies_${{ inputs.module }}.github.json
shell: bash
- run: |
echo RESPONSE_CODE=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ inputs.github-token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$GITHUB_REPOSITORY/dependency-graph/snapshots \
--data-binary "@dependencies_${{ inputs.module }}.github.json" \
-o /dev/null \
-w '%{http_code}') >> $GITHUB_ENV
shell: bash
- run: |
if [[ "$RESPONSE_CODE" == "201" ]];
then
exit 0
else
echo "Dependency submission failed with HTTP code $RESPONSE_CODE"
exit 1
fi
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build
on:
push:
branches:
- '**'
jobs:
build:
runs-on: macos-14-xlarge
strategy:
fail-fast: false
matrix:
xcodeversion: [ 15.1, 15.3 ]
steps:
- uses: actions/[email protected]
- uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ matrix.xcodeversion }}
- uses: ./.github/actions/runGradleTask
with:
task: build
barrier-build:
runs-on: ubuntu-22.04
needs: [ build ]
steps:
- run: exit 0
24 changes: 24 additions & 0 deletions .github/workflows/dependency_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Submit dependencies
on:
push:
branches:
- main
permissions:
contents: write
jobs:
networktime:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/submitDependencyReport
with:
module: networktime
github-token:
networktime-singletons:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/submitDependencyReport
with:
module: networktime-singletons
github-token: ${{ github.token }}
12 changes: 12 additions & 0 deletions .github/workflows/manual_publishing_tag_warning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Manual publishing tag warning
on:
push:
tags:
- '[1-9]+.[0-9]+.[0-9]+'
- '![1-9]+.[0-9]+.[0-9]+-dispatch'
jobs:
print-warning:
runs-on: ubuntu-22.04
steps:
- run: echo "Releases must be dispatched using .scripts/dispatch_release.sh"
- run: exit 1
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish
on: workflow_dispatch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.ref_name }}
jobs:
create-github-release:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref_name }}
- run: .scripts/github/release.sh
publish-maven-publications:
runs-on: macos-14-xlarge
permissions:
packages: write
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref_name }}
- uses: ./.github/actions/runGradleTask
with:
preTaskString: -Pversion=$GITHUB_REF_NAME
# TODO Change this to publishToMavenCentral
task: publishAllPublicationsToGithubPackagesRepository --continue --no-configuration-cache
35 changes: 35 additions & 0 deletions .github/workflows/publish_process_dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Process release dispatch
on:
push:
tags:
- '[1-9]+.[0-9]+.[0-9]+-dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.ref_name }}
jobs:
ensure-tag-is-on-main:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
ref: main
fetch-depth: 0
- run: exit $(git merge-base --is-ancestor $GITHUB_REF_NAME HEAD)
update-xcframeworks-and-dispatch-publishing:
runs-on: macos-14-xlarge
needs: [ ensure-tag-is-on-main ]
permissions:
actions: write
contents: write
steps:
- uses: actions/[email protected]
- run: |
git config --local user.name $GITHUB_ACTOR
git config --local user.email [email protected]
- run: |
TAG=$(echo $GITHUB_REF_NAME | tr -d -- -dispatch)
.scripts/github/update_xcframeworks.sh
git tag $TAG -m $TAG
git push origin tag $TAG
gh workflow run publish.yml --ref $TAG
29 changes: 29 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Static analysis
on:
push:
branches:
- '**'
jobs:
ktlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- run: .scripts/check_ktlint.sh
codeql:
runs-on: macos-14-xlarge
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/[email protected]
- uses: github/codeql-action/[email protected]
with:
languages: kotlin
- uses: ./.github/actions/runGradleTask
with:
task: build
- uses: github/codeql-action/[email protected]
with:
category: "/language:kotlin"

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.build
.DS_Store
.gradle
.kotlin
build/
local.properties
*.xcframework
xcuserdata/
14 changes: 14 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/artifacts/networktime_jvm.xml

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

6 changes: 6 additions & 0 deletions .idea/artifacts/networktime_singletons_jvm.xml

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

8 changes: 8 additions & 0 deletions .idea/artifacts/samples_multiplatform_kotlin_jvm_jvm.xml

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

8 changes: 8 additions & 0 deletions .idea/artifacts/samples_multiplatform_kotlin_shared_jvm.xml

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

29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

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

Loading

0 comments on commit ba6a1ec

Please sign in to comment.