-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CodeQL | ||
on: | ||
# @formatter:off | ||
workflow_call: {} | ||
# @formatter:on | ||
schedule: | ||
- cron: 0 0 * * * | ||
jobs: | ||
codeql: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- uses: github/codeql-action/init@v2 | ||
with: | ||
languages: java | ||
- run: ./gradlew build | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: /language:java |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Quality Assurance | ||
on: [ pull_request, workflow_call ] | ||
jobs: | ||
# IntelliJ formatter is f*#$ed... | ||
# format: | ||
# name: QA IntelliJ Format | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-java@v3 | ||
# with: | ||
# distribution: temurin | ||
# java-version: 17 | ||
# - uses: telenornorway/setup-intellij@v0 | ||
# - uses: telenornorway/action-intellij-format@v0 | ||
lint: | ||
name: QA IntelliJ Lint | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- uses: telenornorway/setup-intellij@v0 | ||
- uses: telenornorway/action-intellij-inspect@v0 | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- run: ./gradlew test | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
codeql: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
uses: ./.github/workflows/codeql.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Release (semver) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
semver: | ||
type: choice | ||
description: What kind of release is this? | ||
required: true | ||
default: patch | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
message: | ||
type: string | ||
description: An optional release message | ||
required: false | ||
jobs: | ||
quality-assurance: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
name: Quality Assurance | ||
uses: ./.github/workflows/qa.yml | ||
versioning: | ||
name: Versioning | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
if: github.ref == 'refs/heads/main' | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- uses: oss-actions/auto-semver@v0 | ||
id: version | ||
with: | ||
token: ${{ github.token }} | ||
repository: ${{ github.repository }} | ||
type: ${{ inputs.semver }} | ||
vprefix: disabled | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: [ quality-assurance, versioning ] | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# region todo(James Bradlee): Find an effective way to do this in a different job and | ||
# download the cache and artifacts for immediate release when | ||
# quality assurance is complete. | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Build | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew build | ||
- name: Release (packages) | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew publish | ||
# endregion | ||
- name: Release (git tag) | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
TITLE: ${{ inputs.message }} | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git tag $VERSION | ||
git push -u origin $VERSION | ||
# todo, upload release artifacts | ||
# gh release create --verify-tag -t $TITLE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release (snapshot) | ||
on: [ push ] | ||
jobs: | ||
quality-assurance: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
name: Quality Assurance | ||
uses: ./.github/workflows/qa.yml | ||
versioning: | ||
name: Versioning | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- id: version | ||
env: | ||
GIT_SHA: ${{ github.sha }} | ||
run: | | ||
echo "version=${GIT_SHA:0:16}-SNAPSHOT" >> $GITHUB_OUTPUT | ||
release: | ||
name: Release (Snapshot) | ||
runs-on: ubuntu-latest | ||
needs: [ quality-assurance, versioning ] | ||
permissions: | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# region todo(James Bradlee): Find an effective way to do this in a different job and | ||
# download the cache and artifacts for immediate release when | ||
# quality assurance is complete. | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Build | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew build | ||
- name: Release (packages) | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew publish | ||
# endregion |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Env.kt | ||
|
||
_Utility functions for RestClient_ | ||
|
||
## Gradle prerequisite | ||
|
||
In your gradle file | ||
|
||
_Follow [this guide](https://github.com/testersen/no.ghpkg) on how to set up your environment for GitHub packages._ | ||
|
||
```kt | ||
plugins { | ||
id("no.ghpkg") version "0.3.3" | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
<!-- @formatter:off --> | ||
```kt | ||
import no.telenor.kt.restclient.* | ||
|
||
client.patch("https://jsonplaceholder.typicode.com/todos/{todoId}", todoId) | ||
.json(changes) | ||
.retrieveJson() | ||
``` | ||
<!-- @formatter:on --> |